Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6500475rwb; Tue, 22 Nov 2022 14:26:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf5fgPmFthLPyno3pW95xuuNRHaxFcQumzDWTonVUWq7fJHZ4jVwddlvCxulYbsTDKkLkYio X-Received: by 2002:a63:ef42:0:b0:438:a46b:63f2 with SMTP id c2-20020a63ef42000000b00438a46b63f2mr5762260pgk.572.1669156000850; Tue, 22 Nov 2022 14:26:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669156000; cv=none; d=google.com; s=arc-20160816; b=t3oWQgtT6tc+TF7T9LghbQSA7ch3IaKFFYcYDXCHEDdpZP/uhqyP6kRqpBpYDNnqok 6X+k9M+c2+sJqT2MdsreMWpu9Z28L19p6cbE4pwAhkTtUv/FUpclKRuN17jkBzbJ99Ob NqHn0VULO5cCCjT0nq6IKUXzqnfKA4sLhIEZGNzlBAXW9qj/NHYCZVQje4KpeAhLNHDr G/JipVJisg5QpjpZHMLiMdZVlyzoTuzQbnNUPJ5OG+GcZW8rRA1tXnWg2t3cLlYTUkW2 asoAiPk5j3gNF8fOoMa7to2xFe+L49LoeJhmtupmZu29I8eUvLhuQbGj2akAErp9GVxJ LquA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pLtyNYbwTS6UwI7s4ntrsfBuNT7TIR6M6ZMzknBdrgI=; b=Hyv6eu1zvvI1ysPkETgZkmASLijpAW88NehFI8hbIEpKf+T8Pm+jvNHFGYGfKZrrGW +g4IJLN+A4QZTFexZShTugLC0KOs+mX1IAlSDjdhcQAMMCrdY4lCQ3z3VUNy6llptoWs EvAHhyu5HkMWVRIk7qMFcURDwwmxfjIi5UaT3+VlukXpGn9n64ClJ+YPulocT15vGKqu y7tZTmzwRFTaJfb12aqtEe5yFdCvSlDGVbQ0HmOs53q90KE1OoHbrrdG+RngkPjXTaQs gnrEoOcAvOTYRiNfignXZq9pCX5SKDyyro7ZAb8QUapF6assrkhcZdXV1/46nuVhOLPC SBhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=l+ORBpuV; 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 t14-20020a17090a4e4e00b0020055731860si103891pjl.105.2022.11.22.14.26.29; Tue, 22 Nov 2022 14:26:40 -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=l+ORBpuV; 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 S234688AbiKVVkx (ORCPT + 89 others); Tue, 22 Nov 2022 16:40:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235141AbiKVVkW (ORCPT ); Tue, 22 Nov 2022 16:40:22 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EE45C6620; Tue, 22 Nov 2022 13:40:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1669153213; x=1700689213; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Hp29edLp8a8OEBxkPTP/BqxOmLMA7en3zD0HWlGqapo=; b=l+ORBpuVVSEyxRrgozTDrDL/P4axGNx5iPZLO+yVYCcWPPqC83k7hpFL tL9fA1d55V0121EDEXgafgjLyKd0fMbkRMdghgYhcFnqBpVMAM1D3sWpN o/uPkaGU3jAYfWySe8AJjwdq+wjHySvcwxWTRwD35EFmggPItOLExVbN2 EylNzVmXK05zL/iidAwnWN87zRZv/W8JQqkeeq7CkSjoZnPJ9MtksOMuF DKQkiqS7n9KmIllLbt6yu0CqSVpqOTFkmsF2AKfLsSstX+3MUfSCKkMSk CLbkEf9YBXaHYa3MGiwSuU9k11YP/Rx7Rf59LBuz5Nf0zasadeDtmeo4R g==; X-IronPort-AV: E=Sophos;i="5.96,185,1665471600"; d="scan'208";a="201008100" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 22 Nov 2022 14:40:13 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) 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:40:05 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Tue, 22 Nov 2022 14:40:03 -0700 From: Horatiu Vultur To: , , CC: , , , , , , , , , , Horatiu Vultur Subject: [PATCH net-next v4 4/7] net: lan966x: Update rxq memory model Date: Tue, 22 Nov 2022 22:44:10 +0100 Message-ID: <20221122214413.3446006-5-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221122214413.3446006-1-horatiu.vultur@microchip.com> References: <20221122214413.3446006-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 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_reg_mem_model(&port->xdp_rxq, MEM_TYPE_PAGE_POOL, + rx->page_pool); + } + return PTR_ERR_OR_ZERO(rx->page_pool); } -- 2.38.0