Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp862904lqt; Tue, 19 Mar 2024 06:20:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWwCAv8AINRBmO3iZ+bJTzy226/rEGymvZw2flpYGl9qgiyzBXAxHO6ohYwp1QtPNx8JGcKIeEbzGNi/hrQQInBEhr4FGoMoSffdu7emw== X-Google-Smtp-Source: AGHT+IHC4Kyq9MGcrhmKDZ+vi/KGmyKHsRuJf1RmWTMeYHlA11qA62WZPOyZpF3ErMbXJqk37OzM X-Received: by 2002:a05:6a00:939d:b0:6e7:386d:ac87 with SMTP id ka29-20020a056a00939d00b006e7386dac87mr4413584pfb.6.1710854405911; Tue, 19 Mar 2024 06:20:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710854405; cv=pass; d=google.com; s=arc-20160816; b=XSxSKEg+QgC3+x4PeoTk5Kzbn7G7ftw7pSHmN05kLoBaJNR0BGFd6DDYzfomp+vLAn lvk/JdCCuksDaqsZxT8f+9EC6bbP15MlzRmQJotWYlc4fhcqC7YaWNw8cA1v/8ObTtbG iJuqGYxmkkWnhlbGy/XOQBgW7i8u2jFri4v0pAzcvRXU1OUKFnG3f11ZxQTvuQBdI1OQ o0GPo+vuL/bfYG5uhRjuJIF09N1odXhji5Uz7AHABT2yVmFeOvX1Y+iPxByS+8wjafuF BW7BXZVzr47Lff/HclLbmApEEDOjNBDoaWeqHg3UHNBRthOCLybnDpkSg+1ezs+a6mfv DAYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=eM2s0jFpcVvcghsG7scph+n4U/V5mjD2JNZH/KutU6g=; fh=+bZdVkiLmz24uXoRZ/h+BNAr4vk9JBC6QsMoFH7X5YA=; b=NcN5Yd2sceBKd+M/hkcmqGWqMW68TVZLO121g5Gc4Q+xfnHfX+SbfPfNFF8rRFXd7C oFlHBJn7iCcIgYCqo+oUbqevE8Fp7flHNRtu5Y8GGQC5OGqlWwCA0eJ5keJ0sV5oMQsk g/rXT1jdh0nx9nI6I4neIkvbgkVE7a4umVMSE1jnkNuXdJHVsRadrZ7hYsYPfr6rnpF3 2v4oPbM/CEIb1/ukba5ReHrjv4HOReXkxzX6si5YKELMnu/745ozxYbReFDp9HSnUFzI El7SYKs9c+qMkpTg5HTl/u+rG8VMj6/DbV/iw+HZglnBYqXbxUIFENFocpZ7jIrlA8SL v4Wg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="zx7C/jNz"; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-107581-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107581-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w63-20020a636242000000b005d576171e69si10220275pgb.88.2024.03.19.06.20.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 06:20:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107581-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=@lunn.ch header.s=20171124 header.b="zx7C/jNz"; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-107581-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107581-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch 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 98C7E284173 for ; Tue, 19 Mar 2024 13:20:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0430C80631; Tue, 19 Mar 2024 13:19:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="zx7C/jNz" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 3B1413FBB9; Tue, 19 Mar 2024 13:19:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710854383; cv=none; b=jVWqLblXaKqmOPntMsbVKGd3TFnSoYEef2W7ZKs6t0wxTXZviggtJTUGX8aSn93oH0+Tm9afdrFqJWlsaWwkle/gGggQIzsFd1MXUfCZLbvXCe8cejcM4TUW1lFc6ufyitESp3r128YP+8LjdjOnZdknDLOegg3Z5dmB0d1KrSQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710854383; c=relaxed/simple; bh=xGfGEg1NmOvDoMhIZ7MT4PvjgibSCw62ywA9sT5WeYI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lheua8Y7GRwbF9TcW60lYV1rGc5Yr0+4j52RkDurCmpvs1RIKm2dQiZNVYAjvx3PO8mpW6JKbn4pu5iKvL1OLYnsOAJuXo0bPr8x9z1+xXv4JsGXyFaad0MlOZnMyKKMtvqgBZBpSviqUMDIRqdUdiatDj5bIk39/RtHjKvU9pQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=zx7C/jNz; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=eM2s0jFpcVvcghsG7scph+n4U/V5mjD2JNZH/KutU6g=; b=zx7C/jNz9btddQyTivtDBwDUVR wThOKRIKBW0/HQS2lbMkEAhKDJt9OMw4V/j17nNBI5cTJ2nlK+5rjQVEJSq927K8tiyb02nRnONh2 gJzRZloQ7xupKPMbHyvXAnmJcXxt6cBbfbvUb6uz/6HfS5htJAliKZNYaw/stjpVGFvw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rmZN9-00AhnS-Kf; Tue, 19 Mar 2024 14:19:19 +0100 Date: Tue, 19 Mar 2024 14:19:19 +0100 From: Andrew Lunn To: Parthiban.Veerasooran@microchip.com Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, saeedm@nvidia.com, anthony.l.nguyen@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, corbet@lwn.net, linux-doc@vger.kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, devicetree@vger.kernel.org, Horatiu.Vultur@microchip.com, ruanjinjie@huawei.com, Steen.Hegelund@microchip.com, vladimir.oltean@nxp.com, UNGLinuxDriver@microchip.com, Thorsten.Kummermehr@microchip.com, Pier.Beruto@onsemi.com, Selvamani.Rajagopal@onsemi.com, Nicolas.Ferre@microchip.com, benjamin.bigler@bernformulastudent.ch Subject: Re: [PATCH net-next v3 08/12] net: ethernet: oa_tc6: implement transmit path to transfer tx ethernet frames Message-ID: <96dd422f-0bf9-411d-8cc2-5755c1e60e27@lunn.ch> References: <20240306085017.21731-1-Parthiban.Veerasooran@microchip.com> <20240306085017.21731-9-Parthiban.Veerasooran@microchip.com> <208fb61b-4740-46bf-8c70-29ab59cbb965@lunn.ch> 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-Disposition: inline In-Reply-To: On Tue, Mar 19, 2024 at 12:54:30PM +0000, Parthiban.Veerasooran@microchip.com wrote: > Hi Andrew, > > On 07/03/24 10:38 pm, Andrew Lunn wrote: > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > > >> @@ -55,6 +77,14 @@ > >> (OA_TC6_CTRL_MAX_REGISTERS *\ > >> OA_TC6_CTRL_REG_VALUE_SIZE) +\ > >> OA_TC6_CTRL_IGNORED_SIZE) > >> +#define OA_TC6_CHUNK_PAYLOAD_SIZE 64 > >> +#define OA_TC6_DATA_HEADER_SIZE 4 > >> +#define OA_TC6_CHUNK_SIZE (OA_TC6_DATA_HEADER_SIZE +\ > >> + OA_TC6_CHUNK_PAYLOAD_SIZE) > >> +#define OA_TC6_TX_SKB_QUEUE_SIZE 100 > > > > So you keep up to 100 packets in a queue. If use assume typical MTU > > size packets, that is 1,238,400 bits. At 10Mbps, that is 120ms of > > traffic. That is quite a lot of latency when a high priority packet is > > added to the tail of the queue and needs to wait for all the other > > packets to be sent first. > > > > Chunks are 64 bytes. So in practice, you only ever need two > > packets. You need to be able to fill a chunk with the final part of > > one packet, and the beginning of the next. So i would try using a much > > smaller queue size. That will allow Linux queue disciplines to give > > you the high priority packets first which you send with low latency. > Thanks for the detailed explanation. If I understand you correctly, > > 1. The tx skb queue size (OA_TC6_TX_SKB_QUEUE_SIZE) should be 2 to avoid > the latency when a high priority packet added. > > 2. Need to implement the handling part of the below case, > In case if one packet ends in a chunk and that chunk still having some > space left to accommodate some bytes from the next packet if available > from network layer. This second part is clearly an optimisation. If you have lots of full MTU packets, 1514 bytes, they take around 24 chunks. Having the last chunk only 1/2 full does not waste too much bandwidth. But if you are carrying lots of small packets, say voice, 130 bytes, the wasted bandwidth starts to add up. But is there a use case for 10Mbps of small packets? I doubt it. So if you don't have the ability to combine two packets into one chunk, i would do that later. Lets get the basics merged first, it can be optimised later. Andrew