Received: by 2002:ab2:1c04:0:b0:1f7:53ba:1ebe with SMTP id f4csp152750lqg; Fri, 26 Apr 2024 11:15:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzQi6ynRqQFVSzXVxM3iy8DrxRtZDw4QM/YKgAD639KeileeQJOZcOlu/EXCLL1o/5Vsq92Mi2XyoqM+IhwCQgT8nZyQ+wgM03L7I7Ag== X-Google-Smtp-Source: AGHT+IEjpOtUQ1LJRi/gXI6Ms9Co3FZXADQMFnoAtJo3EYF93BR1+/Q0+YYQHeNxQHXdmX5t2O6g X-Received: by 2002:a05:620a:2057:b0:78e:f092:88d4 with SMTP id d23-20020a05620a205700b0078ef09288d4mr496114qka.70.1714155324748; Fri, 26 Apr 2024 11:15:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714155324; cv=pass; d=google.com; s=arc-20160816; b=BnBOHpRVNHA9/6CP1kxCRRJXoYZ6U7mfsAgPbCZBISiUFRR96qfOY41nPjS/EdNKFA bMM2HRXFpTi4s0hciWvgyNxP8EenTTD9z3TCZt1sw7EdE2loNc8vdijE5FOOSxFa9+CU msblchPdrlRCR2jaPFRVkplfDnZFhCuoxO9Q4KaS36FVDQHXBXt/aJlT2OY1Pg2CxWxD AFycQ4e+mxk8pTZQSBuKdkuTw9+PGIQ5EV7Lc0+L3ssjS5lneXbHBF+Akadevm3TqSV9 /96zxZPelYGh0/f3yCTinFNjzYkHZ1xBg4Bef1O0xJWnevnd7V1ZGlx1G7Mq1uKI/LUs JpjA== 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=Z0WylHOBJi80XW5YVifjTqADU8U9Hi2JH9CbGlTpRYM=; fh=+bZdVkiLmz24uXoRZ/h+BNAr4vk9JBC6QsMoFH7X5YA=; b=uCMnLyVo73gH7yVgfE7oHOt4DlCPqvqSdowWiEMJQ00btDJegbX7yNDtzjJu0njgD5 eKPAbyW25S00thms6ush4gxYqVelJu+hIY8+jwrH8/QKS0eXTI2CMglcyr9MmDhERq3G ZUNu99nVUr2X+ZM8dn4EBz0HuitRsxSHdmTyaxw6+o8WKzsf/5DDsar73l153boTxHx4 DJgPSGXbS1U3JgxEFd6RNJTeEpwbXa5xLT2u1EjqqjfSiUeMDcCF0tpYpO/aIIzo0Tor wI2jPjKs7dwsNNGILtiPrd+11eCBgxXurrH2avQqxvU44XShVCuyR7xyryJHyKPBq06k BvEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=s0SGDObx; 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-160553-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160553-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id pa9-20020a05620a830900b0078ec0f75505si19049676qkn.318.2024.04.26.11.15.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 11:15:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160553-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=s0SGDObx; 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-160553-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160553-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7A55C1C212C8 for ; Fri, 26 Apr 2024 18:15:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 309E916F29B; Fri, 26 Apr 2024 18:14:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="s0SGDObx" 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 1FCFC16D9DC; Fri, 26 Apr 2024 18:14:00 +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=1714155243; cv=none; b=aPebWb/bgZbmSuGeSmSsAmOpxJ415juiVGZPzBabBL2nylL1REoPlN+Bd5VudCYjRPCFgTK9AkICsrUYH4J4mI+LVdGJO7bZhBpXZe5LKGrQXGllsxvtvOID+avmqg0HQEtkiD5yhSVvIk5OFydKrB4qI4DoOuCpikY8CIvR1f4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714155243; c=relaxed/simple; bh=aQjaL5v7EZ8Z8sheHSuTK0i8DbEog35lMqyjMZuJSH8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SGNV+Nfog7NNTKlyPolKD+u1SZrGhwPBa5ppUlutxAV8q4A2pbiGfDUuKYRmXrqcVjg+2CYa0YczhmT1iZ3vFYuKGF0l7V3dwUzlJBuq4KS2nbb1M01mrDqqjTNx89SQYXnc8n2gXvLhZ/VGQTZ8cHh25FpXyfxuv66OE/acww4= 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=s0SGDObx; 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=Z0WylHOBJi80XW5YVifjTqADU8U9Hi2JH9CbGlTpRYM=; b=s0SGDObxH6/3Xck4YBOF4zBOOG fnpQUiVzrD846i2Wd6hb/iY8DDkplyuhIvX1OkoiBceOFTtt9ppqHNI47PrIkylMuaDy2/00rK467 KlBoZS9/H4jRdhfmLworvUxCa5Lg8o0ZoCedMMz1SQY4z0M+7x9vZd8JQqo8D0U+bNIQ=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1s0Q4k-00E62L-4W; Fri, 26 Apr 2024 20:13:34 +0200 Date: Fri, 26 Apr 2024 20:13:34 +0200 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 v4 09/12] net: ethernet: oa_tc6: implement receive path to receive rx ethernet frames Message-ID: <669541fd-abc5-4461-a92f-af5a09c1e1e6@lunn.ch> References: <20240418125648.372526-1-Parthiban.Veerasooran@microchip.com> <20240418125648.372526-10-Parthiban.Veerasooran@microchip.com> <574fec4d-5a23-490a-ba12-c40432ebe4b8@lunn.ch> <6e529720-3caa-4dc4-b9be-bc6674806ba5@microchip.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-Disposition: inline In-Reply-To: <6e529720-3caa-4dc4-b9be-bc6674806ba5@microchip.com> On Fri, Apr 26, 2024 at 01:45:20PM +0000, Parthiban.Veerasooran@microchip.com wrote: > Hi Andrew, > > On 24/04/24 5:38 am, Andrew Lunn wrote: > > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > > >> +static int oa_tc6_allocate_rx_skb(struct oa_tc6 *tc6) > >> +{ > >> + tc6->rx_skb = netdev_alloc_skb(tc6->netdev, tc6->netdev->mtu + ETH_HLEN + > >> + ETH_FCS_LEN + NET_IP_ALIGN); > >> + if (!tc6->rx_skb) { > >> + tc6->netdev->stats.rx_dropped++; > >> + return -ENOMEM; > >> + } > >> + skb_reserve(tc6->rx_skb, NET_IP_ALIGN); > > > > I think you can use netdev_alloc_skb_ip_align() here. > Ah OK, then do you mean we can rewrite the function > oa_tc6_allocate_rx_skb() as below? > > static int oa_tc6_allocate_rx_skb(struct oa_tc6 *tc6) > { > tc6->rx_skb = netdev_alloc_skb_ip_align(tc6->netdev, tc6->netdev->mtu + > ETH_HLEN + ETH_FCS_LEN); > if (tc6->rx_skb) > return 0; > > tc6->netdev->stats.rx_dropped++; > return -ENOMEM; > } Looks about right. But i did say 'I think', meaning i'm not too sure about this. I generally don't review code actually moving packets around. It is what developers focus on, test heavily, and so is generally O.K. It is the code around the edges which often needs improvements prompted by review, ethtool, PHY handling, statistics. Andrew