From patchwork Sun Jan 28 20:10:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13534635 X-Patchwork-Delegate: kuba@kernel.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (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 C9B4B41C73; Sun, 28 Jan 2024 20:11:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.22 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706472698; cv=none; b=ZsQ42ECIfQSJ9JB6Y0kXM6iOyBZFTgeeD8f987SGpIdsxTN0/V8lEOZVupXaBk7tFCX657bs1JnCKyne/CJkNVwnRPxHNs4a1YHitFbrKkj+iSCWvZyMM0ba7rSqo66PJ/S8YJuZX9TdV/Ru+xEVixe6ZpYE5bUoSxWyCFvolCc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706472698; c=relaxed/simple; bh=brs+KzeuIYeo/VPn51BkrIoo6mMzcYsP95CaSI8Cyqs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=evbzMxYPzXgnlnDANEEC4rGHPWem5V8zQCDtn0NtpHZmw3wVZdrHOeampCwGXjRhC8y+IlcaUgonKmx51ssvnKNQqQ+40QPw/VOTNDGF+TtMp8BH10X5JC9+6OD7sGCkFwmoqs+pn3YSECqL9CMfxNlIptp92OIjBme8iu4hoy0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net; spf=pass smtp.mailfrom=gmx.net; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b=p9N4VS6T; arc=none smtp.client-ip=212.227.17.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.net header.i=wahrenst@gmx.net header.b="p9N4VS6T" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1706472682; x=1707077482; i=wahrenst@gmx.net; bh=brs+KzeuIYeo/VPn51BkrIoo6mMzcYsP95CaSI8Cyqs=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=p9N4VS6T8VrwoDIQhyxjJFS1gIQDqmoWbKFzaXJ7FSpjkgbfKTGM3/ewnE1xxlOO 52CGUGrGckxainniGgIjWI9pIC9TOsr6VbNikZBQkqTAdBAt44Kf85k7lGAXPpCiw BPt9xO8hfEJ00y6J7+c/C5cRYMXKeT6FdNqFN+V183yTE85yC/jFNWEZZTQoBIutL iVjvxPGTyhyfrfUGJZDhBM9mLLLuAWsTai5EPfxyCirZqukHabXaBlgK3BL9eTtb4 064dchEUQEtCX8YULq5Dj4C7ZQTaBzxMJlVtdejq/NS36HsxTaTI7gDHAHM7Cb3NP GNliornm0xFaz8e/KQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1My36N-1r8vp72Eyl-00zWGb; Sun, 28 Jan 2024 21:11:22 +0100 From: Stefan Wahren To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Lino Sanfilippo , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Wahren , Jacob Keller Subject: [PATCH V4 08/15 net-next] qca_spi: Introduce QCASPI_RX_MAX_FRAMES Date: Sun, 28 Jan 2024 21:10:52 +0100 Message-Id: <20240128201059.6259-9-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240128201059.6259-1-wahrenst@gmx.net> References: <20240128201059.6259-1-wahrenst@gmx.net> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:1aI6hyxVWayTcrdbOb7yY/nFyOSxa78d9MrfQ4Geyxrmfm4OOl0 jo+mGZ4R51wU/lbC3R5LiCTVMia9PuXtdvG9EFCIauNbVwYh6q5UfMRKw9y6mLd/DzpGVQ4 LbRXGfNU63njrIvI/c+cIDtizFtSflCgdRgE1B8WMN46vpQktF5C97h2MQ/NkzXV2WXfvIE TI4F3K6SGL0p8fshRmIsg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Xbs6vihAokg=;TwnCR9Wkj9Yf9wWnXU7JTQFfjuN j4lLumrIOJdvJ+UDLcQFSjoUwAULG0VuUfqo1qCiqlJxN223c/U4nATZUJEpvSsvDAowQI/IE tMux6eDwbIlnmt65anhHRuuXW+bbSKH4DxYZaf1c8nccAtFug6e3916Hogt7Q9C6+5uaJ7BOV +Lr4WEoDe4C9vSrCvk3n6mJxLlnXayaiOQc5HAEn2Y+iF0fsuN5UcsBNIs0rTxWfSFNZF4NPv QzFsllIFZpzmyG6/7LeDuCjuyQ8ZuxL8qzykHJzBnWVmGCnbzsruvApOJ8bkEyDqv8ukvuiVJ gxJut0S2i2QKp0Mk+KKHe7Nllj/eWMLM3CgMf8c5v0Am+I9hCinLGDUpvyAuwrYrG7/18KB56 kc+LmjkBHWWhpVUPRFns3M6993kGPDAwFbNxYMwuQ6QOWcg2Sh3TflrXrGZ6/mwjZCNRcmB2V dcWxUkgG9tdfH1ucQMQ0e9kYXTrzxc7PkMcbet1ZmmehfRXzvU/7i5i1O6VUxAG2NmSF3Ko/u yyQwdvfIrOaN6J7kVbvk5gglnmXojj/wjMALLob9m0H2SqAA6vlmf8COchMFvk4DwbotLyM1w ED5OpaGW3csS3rx3JoW/VFv82Mv3Txb8IWs0Tl34X/0wnG3SrYnXe3Qf4ZfsooEluxYXGUXF6 hydq5scQkB+ntcYq6HLZFqXC3iIiiNI4hKGVEAbqdPjFciphhraRn77xEG1S+LKEcQAolhicu +yw1eh94o05v70zGA8VkUiDZdVNMI/Ek6tqkxYssb4u+08bTdoqkw7E1Teup1vE56042JYESw Dxvv8uEPxk+GfB3D12iep02XDvZcER3wCWR/7vkCW9S9/LuvFx3MCVCarrEvRJ+VBAH/fHd5B vnKRiV2f6nvsRcmrbeg/29spD0cCzpF/qh0JjhY1up2XAr6igWOtwNPczbHBt4msdatq5ovLx 0Vi20A== X-Patchwork-Delegate: kuba@kernel.org Currently qca_spi reserves enough space for 4 complete Ethernet over SPI frames in the receive buffer. Unfortunately this is hidden under a magic number. So replace it with a more self explaining define. Signed-off-by: Stefan Wahren Reviewed-by: Jacob Keller --- drivers/net/ethernet/qualcomm/qca_spi.c | 2 +- drivers/net/ethernet/qualcomm/qca_spi.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.34.1 diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c index f53438c4aea2..c0f6bd3d331a 100644 --- a/drivers/net/ethernet/qualcomm/qca_spi.c +++ b/drivers/net/ethernet/qualcomm/qca_spi.c @@ -829,7 +829,7 @@ qcaspi_netdev_init(struct net_device *dev) qca->burst_len = qcaspi_burst_len; qca->spi_thread = NULL; qca->buffer_size = (dev->mtu + VLAN_ETH_HLEN + QCAFRM_HEADER_LEN + - QCAFRM_FOOTER_LEN + 4) * 4; + QCAFRM_FOOTER_LEN + 4) * QCASPI_RX_MAX_FRAMES; memset(&qca->stats, 0, sizeof(struct qcaspi_stats)); diff --git a/drivers/net/ethernet/qualcomm/qca_spi.h b/drivers/net/ethernet/qualcomm/qca_spi.h index dcecb072b8eb..f735ad77402f 100644 --- a/drivers/net/ethernet/qualcomm/qca_spi.h +++ b/drivers/net/ethernet/qualcomm/qca_spi.h @@ -41,6 +41,7 @@ #define QCASPI_TX_RING_MAX_LEN 10 #define QCASPI_TX_RING_MIN_LEN 2 +#define QCASPI_RX_MAX_FRAMES 4 /* sync related constants */ #define QCASPI_SYNC_UNKNOWN 0