Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3187036pxk; Mon, 5 Oct 2020 03:32:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOiiOURt8o0gg+17TWG5ekafAylg0tBzG00OCab0AoPr3vU9q77HUdQeKLyiN3/n7luYxo X-Received: by 2002:a17:906:49c6:: with SMTP id w6mr14559483ejv.445.1601893936037; Mon, 05 Oct 2020 03:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601893936; cv=none; d=google.com; s=arc-20160816; b=WZNCs58pRQcc14CjrK0+vzgM8q3LCJ0LjZHXVWtoM9cmSZSI/HxZ97euye1irUyniI DGdG2jAIwmz+X8E/pwRMoqnRUiG/wNac6vqnvnEmZ0lo7YD/b476twRQ0TG4jtcYlfl9 2SG0VY2dTmKc3qYRjOcdkC/eX/D7Nni3Ipid7rLIgOCb6qVXr8VxLErvmQHCpDdP7n99 CDzDm8GE9hZARw3ifAwgL19D0cUx3UzXY0fM/V/g/HWE3e5LmOVrKD4iv3ahdBSJwoJL 7n7/n3HoHw/CFa4BVm8skJUVR0ekwwULL2Sp2w8LIN8ZHI34qV2wfPq4KJqak/uGaLP6 ipRA== 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:dkim-signature; bh=kVhUbMqkl50NUt1sIhZvX9dRIwQ1NvTDDawX0IDkJE8=; b=oH0mz6YqU48kmFvGoQndYI9BMhwtEdsd+iAsUUFt+b3/z4zts5CjHhSZk6xmq9QckG la1jEiYZrGCfMu9Z52m8KI8u5VG6RpJAjql2ZU6sK/JXy0L7bOBvCgQYrAxg5g7z7TUA nYUhjOYIdfKjts52m5yOiFX0Xd+AS8oXH4t/bj+hbMeASDv+4bsjceEWA6uy7waFqsm/ k/0htxXvV3IxmKlBP47cyGtQioCCDDTVGhkgu0uRsZh7A23E1bp47KWuwMo6kgoJ5ZuD Q+DC7FrmhbPNucaTM/RwJxGKRRqV+8At3bIuAp2DZd5a3BZef9uSaFVncs4cQ8wL/Ork XiYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="IxWodR/+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si2176139edj.536.2020.10.05.03.31.53; Mon, 05 Oct 2020 03:32:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="IxWodR/+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725984AbgJEK2U (ORCPT + 99 others); Mon, 5 Oct 2020 06:28:20 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:51656 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbgJEK2T (ORCPT ); Mon, 5 Oct 2020 06:28:19 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 095ASG7F105181; Mon, 5 Oct 2020 05:28:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1601893696; bh=kVhUbMqkl50NUt1sIhZvX9dRIwQ1NvTDDawX0IDkJE8=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=IxWodR/+BiYFO2Dhs/itKsJJdtRC6E5s5MEsdixpYNqadgMJ14AR52ssLjg9nJL90 We0918JyuVByLv/3lthJ0LfM4KqArmA+8WJ+wuGR9wMAhvcErKl7/+8qJ5O6q+uPr3 twqEMBtGqCW8BK53L+9X6Uf/+OyCKHiwuy3fRvHk= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 095ASGaX109214 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 5 Oct 2020 05:28:16 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Mon, 5 Oct 2020 05:28:15 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Mon, 5 Oct 2020 05:28:15 -0500 Received: from [10.250.100.73] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 095ASCVP129182; Mon, 5 Oct 2020 05:28:13 -0500 Subject: Re: [PATCH net-next 7/8] net: ethernet: ti: am65-cpsw: prepare xmit/rx path for multi-port devices in mac-only mode To: David Miller CC: , , , , , , References: <20201001105258.2139-1-grygorii.strashko@ti.com> <20201001105258.2139-8-grygorii.strashko@ti.com> <20201002.190931.2160541172091214230.davem@davemloft.net> From: Grygorii Strashko Message-ID: <29aad51d-0974-cb1c-4725-7ac6d8dc6402@ti.com> Date: Mon, 5 Oct 2020 13:28:11 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201002.190931.2160541172091214230.davem@davemloft.net> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/10/2020 05:09, David Miller wrote: > From: Grygorii Strashko > Date: Thu, 1 Oct 2020 13:52:57 +0300 > >> This patch adds multi-port support to TI AM65x CPSW driver xmit/rx path in >> preparation for adding support for multi-port devices, like Main CPSW0 on >> K3 J721E SoC or future CPSW3g on K3 AM64x SoC. >> Hence DMA channels are common/shared for all ext Ports and the RX/TX NAPI >> and DMA processing going to be assigned to first netdev this patch: >> - ensures all RX descriptors fields are initialized; >> - adds synchronization for TX DMA push/pop operation (locking) as >> Networking core is not enough any more; >> - updates TX bql processing for every packet in >> am65_cpsw_nuss_tx_compl_packets() as every completed TX skb can have >> different ndev assigned (come from different netdevs). >> >> Signed-off-by: Grygorii Strashko > > This locking is unnecessary in single-port non-shared DMA situations > and therefore will impose unnecessary performance loss for basically > all existing supported setups. > > Please do this another way. ok. I'll try add lock-less push/pop operations and use them for single-port > > In fact, I would encourage you to find a way to avoid the new atomic > operations even in multi-port configurations. I'm not sure I how :( The DMA channels are shared, while net_device TX queues are separate. I've thought - hence there is 8 TX DMA channels it should be possible to use qdisc, like mqprio to segregate traffic between ports and TX DMA channels in which case no blocking on tx dma locks should happen in .xmit(). Thank you. -- Best regards, grygorii