Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp1039579lqo; Thu, 9 May 2024 03:00:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU/t2XCwhsGx/PjKmkwbD56xLgOxyjCDE6GmrnO6n8DWU6VRMiwEHMJOT/7eEgS9hflGGwOA7peCzuqXeQrZOBld7fVDNt3ZiBI+gOUOw== X-Google-Smtp-Source: AGHT+IFt0LPtIGyh6SFCFcRF6ERyJHxzRV+gsIyJRIjECQvpHGWMUNGXM5SMK2vK7/48Be7G+PMc X-Received: by 2002:a05:6a20:9e4e:b0:1af:5a6f:1c62 with SMTP id adf61e73a8af0-1afc8d05aecmr6599567637.4.1715248856133; Thu, 09 May 2024 03:00:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715248856; cv=pass; d=google.com; s=arc-20160816; b=W2lRQNoKlkTDKHVWcfX4ZQj0dYTVCnGS3RDWKaE7ul2RVc/SaW+g966xeEfGeFq/NW CtODzY53waMNkLQ0P/wzwaNDFQbD1Bq1O4cKteHlVhpb0gKbwpryA9gbJHvJjFETzx7U sK3diLsbPhMeeJh6TPZ6IuN6AdnSF4gsw0/nOjpFuAAes6KOg+jDA4G7Y7pQ3z9PRv8s 4b8hEstZbPEE4xe/2FJmrdj8hhIwklsWB6yOmHob+/4b/IG2TnYiZJv/k4BseI/xegr+ KpPP6RzpGJgAp3WdLaD7PIaEISYt0E1FeIsJZ3S0K0IPSoWYGr2ucb4Crj/v0GCrh4By T3dw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:content-language:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=+Ux77plTl+xZ3+j/qyMVKWEAGQlvETQaVRcXuW5kpmM=; fh=4BZBcyHdOhjHS5mkqEqYfTkhq0a5/gGcfQZWC22V3dI=; b=mB/R9DtP20yDrwBRdJmTT/syhtdZv4JmiG5+PmqgtMyIfCX4RcrPtcL16f/sNQK9LF MTFAzrChhIxvKXcsDBXn8aEb1IgYbhkX1AwMaaWRmPIaowGWiQdNCm3p5zSS5bAT5n0g eQY4uE6kySgQY8MI3KgNwFnd24npKShY3AlpSaYDYv7mMgqOIMYGjQFid4JQYQCwM9zz N9O0k+w2uuXoKDZd3bvZoR8hbrzz5m/AW0K+G+iOluSj4ngzC2nNYjanpt4dPJLVDXrC Y+ineB9j1K9fM35uJ42R8DTEN0y3+mp3aZB7cv3qfqtKEm/iuhciOtNJnKl6seOD6uPu jvBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-kernel+bounces-174381-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174381-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2a9186asi1160439b3a.102.2024.05.09.03.00.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 03:00:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174381-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; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-kernel+bounces-174381-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174381-linux.lists.archive=gmail.com@vger.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 B549C283DAA for ; Thu, 9 May 2024 09:59:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F3AF14B06A; Thu, 9 May 2024 09:59:35 +0000 (UTC) Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A95F14AD1A; Thu, 9 May 2024 09:59:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715248774; cv=none; b=kLPMb/V+EMG+3KEavF+f8NgvHQ6hw4l9W6NuRm7s8xSCb4valSUDV/JGDyUU1wiKCWDBFCEWqNZaDjegG7X7ZuuI0Um4OGafPJQCxA2A4h/J6eb6ahtVqlgrZnwjdqbdYo+iQ1FcGo2ZdtuieCh7kSpHbc3mrnU5fSvffTKtexs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715248774; c=relaxed/simple; bh=dtQ5WtrGDhIWgT1qeZF8014MTF0JeO8/hPqjUWcHDGY=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=DHd44pzcD+A+i5/wl2GdIW/Z1RMA0wAhi38l8AvfKC65aOIuDNQaU/xV3ifyGD37rgEXV4eSnK6CLVPp79m+Qnmis0O/SqbC5abtbeBs32wsqZiGddoOWiIWyznwYJ831R+lrqpreKCzg0HiWvoNGutFoZWvzniXUU1zuRqvwZk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4499x4Jd91475338, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 4499x4Jd91475338 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 May 2024 17:59:04 +0800 Received: from RTEXMBS06.realtek.com.tw (172.21.6.99) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 9 May 2024 17:59:04 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXMBS06.realtek.com.tw (172.21.6.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 9 May 2024 17:59:04 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::1a1:9ae3:e313:52e7]) by RTEXMBS04.realtek.com.tw ([fe80::1a1:9ae3:e313:52e7%5]) with mapi id 15.01.2507.035; Thu, 9 May 2024 17:59:04 +0800 From: Justin Lai To: Ratheesh Kannoth CC: "kuba@kernel.org" , "davem@davemloft.net" , "edumazet@google.com" , "pabeni@redhat.com" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "andrew@lunn.ch" , "jiri@resnulli.us" , "horms@kernel.org" , Ping-Ke Shih , Larry Chiu Subject: RE: [PATCH net-next v18 02/13] rtase: Implement the .ndo_open function Thread-Topic: [PATCH net-next v18 02/13] rtase: Implement the .ndo_open function Thread-Index: AQHaoUT5RWh4TO7cuUeh1vkT8i8o3LGN87+AgACfZICAAApUsIAADPfg Date: Thu, 9 May 2024 09:59:04 +0000 Message-ID: References: <20240508123945.201524-1-justinlai0215@realtek.com> <20240508123945.201524-3-justinlai0215@realtek.com> <20240509065747.GB1077013@maili.marvell.com> <9267c5002e444000bb21e8eef4d4dc07@realtek.com> In-Reply-To: Accept-Language: zh-TW, en-US Content-Language: zh-TW Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback >=20 > > From: Justin Lai > > Sent: Thursday, May 9, 2024 2:29 PM > > > > + > > > > + /* rx and tx descriptors needs 256 bytes alignment. > > > > + * dma_alloc_coherent provides more. > > > > + */ > > > > + for (i =3D 0; i < tp->func_tx_queue_num; i++) { > > > > + tp->tx_ring[i].desc =3D > > > > + dma_alloc_coherent(&pdev->dev, > > > > + > > > RTASE_TX_RING_DESC_SIZE, > > > > + > > > &tp->tx_ring[i].phy_addr, > > > > + > GFP_KERNEL); > > > > + if (!tp->tx_ring[i].desc) > > > You have handled errors gracefully very where else. why not here ? > > > > I would like to ask you, are you referring to other places where there > > are error description messages, but not here? > other functions, you are freeing allocated resources in case of failure, = but here, > you are returning error directly. >=20 After returning the error, I will do the corresponding error handling in rt= ase_open. . >=20 > > > Did you mark the skb for recycle ? Hmm ... did i miss to find the cod= e ? > > > > > We have done this part when using the skb and before finally releasing > > the skb resource. Do you think it would be better to do this part of > > the process when allocating the skb? > i think, you added skb_for_recycle() in the following patch. Sorry I miss= ed it . > ignore my comment. >=20 OK, thank you for your feedback. > > > > > > + > > > > +err_free_all_allocated_irq: > > > You are allocating from i =3D 1, but freeing from j =3D 0; > > > > Hi Ratheesh, > > I have done request_irq() once before the for loop, so there should be > > no problem starting free from j=3D0 here. > Thanks for pointing out. Thank you also for your review.