Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2773466rdb; Mon, 12 Feb 2024 16:51:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXP7GDTuk6cFyz4b0Xa+cvLriGyTdwESKrZLPRDDM0HK6jNVmkd+8DzCFNdv1Mk47/CA6iqj3RXZIWoDr01a6erKr6aK0z3KpWSOYrbRQ== X-Google-Smtp-Source: AGHT+IGwnVo5tA4KtiuAFUPPByKN2S6gTXExHXDWtPIvwcjYpaiFbhyfkduKpwmzQLdL1QbnUWm8 X-Received: by 2002:a05:6358:2607:b0:178:fe3e:1e35 with SMTP id l7-20020a056358260700b00178fe3e1e35mr14173296rwc.13.1707785505762; Mon, 12 Feb 2024 16:51:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707785505; cv=pass; d=google.com; s=arc-20160816; b=X92+HMHxjsKRPm8erRA9N0My4WgdmxWoVgfSBMtnQhnyX37X+6tebFFMnBSNa7CQHR sf+4AcXQjldpAxTA9eQEZt4QZyge77Y7WGEtSXtqPJ1mvvrcJdZs8lUHclbi6PJssoW2 yPrM24jbq0pMFyGknRkYeM0o2D1uQURLceqPmqWqxVKdIC4cHO+8/vxdyuSCoHXS1fav oZyzQfS7BU671Wa3e6SuXzFCZ09XgDekjc6d0Zp4JH3MLSwoLnmxNot71XZK8e7ytVV8 /vgdqDQPfhM2Cua4wSO4xBlKGkNBs0TM+Ap/P868s2REQ34Ao4TNdP02hs7alJRjLJFa pTng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=N0M3vlKgD3SZyqZ71tUL/aZqIFHzAsym3l7hB6fqaZY=; fh=r2+GV6gWY6phPIwI+ViZpkg8OL+Wsxc9rZ/5RimPXd0=; b=vC007gVT0k4seaOrtH3OOFClve3UDj8YdG8WABQVm/A/CYEK4HdA9pT1M5+w8sJ9nY q1n4xsh+FU+t/3P6eE0JjDym37M5/qITd2Rjx90sC3aoKUr8ZtgajZmR22MvBcV5I+TK jl1KNrjA+/vl/ytpxkCar/GjdRwRil97zNiiZZ7emlJ1vBb0PQwTo5SCX1K/96gChW9Y /o3uKSq94tPKZNBOlTlh1ZPJbDthuNjcFibKEdWQj/JGQ9CUYiNaAtPlDl3JmZTmEPoI GaFYMJyeQV2yFuw2BaldIKBSNpLORGkAoy1Yy2E8mJt3M2nty8g9DK8uf+Kid53e61tq dKig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O5jKDBM0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-62691-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62691-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXfrJibTTMN/5jY+Vz55Q7Jo0q5qAf2pk4Td9sqMUl/pFr8EVsuVhwHY2/Q7HYE8K3rxGaFjLtsxD64eHvZih7Y7npf1w6SxrUqzfXLcw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d124-20020a633682000000b005dc4b41e2d0si1030986pga.591.2024.02.12.16.51.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 16:51:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62691-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O5jKDBM0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-62691-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62691-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6C3FA28570D for ; Tue, 13 Feb 2024 00:51:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D38B7868E; Tue, 13 Feb 2024 00:22:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O5jKDBM0" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EE1077F38; Tue, 13 Feb 2024 00:22:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707783766; cv=none; b=X+RUlsmW2S8oXrx6NHM6VJIDeQN1aGCaldZ1GXDNKHqoCU+rsMOP8skZ3H0Z6/RUyc/SvDniP2G4zFUDieRvSyYHbNfl1hU7KN025b6pESKdEty8Z6vg5Eu82BLLY/lFyX5SpT1BD6eHvVvmrPgroJ+2a3IYj0tCISNxU3ahkLk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707783766; c=relaxed/simple; bh=TuTEr8omUxfqM1O8DocELWTt9yAKpzvpGXNjHsPxxuc=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Wu0MeY3X5d6ibsGSJpJMtV4f1Fn4dd+uailb5fFM4vCZ3BnkKLp+tBpd12SSiIPnUy7jXDwRXkh81QX+axhsJ8fl1YI6/aXM/0lq2RhslqS5VsxyOIM/eH6tz79Qy8uf6ibE2PBkqz8hEU3bKHAmK5pQ6M1JPa0F+SbDYmwW56k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O5jKDBM0; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF312C43399; Tue, 13 Feb 2024 00:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707783765; bh=TuTEr8omUxfqM1O8DocELWTt9yAKpzvpGXNjHsPxxuc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=O5jKDBM0g7YIMdQomXfz1EQQYXPp37dpkB4EONhCwaIyb0zjxJCTGjHrZ/5TroElx Bzp0e5kFbTmwK6t28wyoWt/fBp7Fixsbd6mWPSWid2Ore7tNbIwlNE7YT57QPQPzXM PZadVo5wKMlLuZTowenZP9hVkjfSqkcgCaESHfYXE7OlUXW66va3IUrGWFZd5cyM7T TIhWZx1SwFIgqa7Zo8rVTtomiFD7xJcdpfFm9ZXlH8pa9VIqtVWY7YWKYbOBUAECyR F8yL2UCW4RJ+hOggfVngUXf+prjvJuhXRGRQ0i6e1IkrNFRxAxeq6az9LQtZ+sawD8 fMSgyCqhGKuEw== Date: Mon, 12 Feb 2024 16:22:44 -0800 From: Jakub Kicinski To: Elad Yifee Cc: Felix Fietkau , Sean Wang , Mark Lee , Lorenzo Bianconi , "David S. Miller" , Eric Dumazet , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH net-next v3] net: ethernet: mtk_eth_soc: ppe: add support for multiple PPEs Message-ID: <20240212162244.3c011072@kernel.org> In-Reply-To: <20240210135620.28368-1-eladwf@gmail.com> References: <20240210135620.28368-1-eladwf@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 10 Feb 2024 15:56:07 +0200 Elad Yifee wrote: > Add the missing pieces to allow multiple PPEs units, one for each GMAC. > mtk_gdm_config has been modified to work on targted mac ID, > the inner loop moved outside of the function to allow unrelated > operations like setting the MAC's PPE index. > diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c > index a6e91573f8da..5d5cf73a5d5a 100644 > --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c > +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c > @@ -2010,6 +2010,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, > struct mtk_rx_dma_v2 *rxd, trxd; > int done = 0, bytes = 0; > dma_addr_t dma_addr = DMA_MAPPING_ERROR; > + u8 ppe_index = 0; Please don't use u8 for basic on-stack variables unless it matches some HW field which is 8b. > @@ -3358,6 +3350,8 @@ static int mtk_open(struct net_device *dev) > struct mtk_mac *mac = netdev_priv(dev); > struct mtk_eth *eth = mac->hw; > int i, err; > + struct mtk_mac *target_mac; > + const u8 ppe_num = mtk_get_ppe_num(eth); nit: Please order variable decl lines longest to shortest. If the order breaks init, you should move the init to the body. It's a bit unclear what the difference between ppe_num, num_ppe and ppe_index, id and ppe_idx are. It'd be good to increase the naming consistency. > @@ -1311,6 +1313,7 @@ struct mtk_eth { > struct mtk_mac { > int id; > phy_interface_t interface; > + u8 ppe_idx; this looks misaligned > int speed; > struct device_node *of_node; > struct phylink *phylink; When you repost please do not reply in the same thread. Start a new one. https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#resending-after-review -- pw-bot: cr