From nobody Sun Dec 14 12:13:42 2025 Received: from mx0a-0024c301.pphosted.com (mx0a-0024c301.pphosted.com [148.163.149.154]) (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 4A996346761 for ; Fri, 14 Nov 2025 15:08:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=148.163.149.154 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763132930; cv=fail; b=q8z8iH1tTcdrPx6vri2OjuKbcer7ikjUIuVJoC6xrCw/wd2JYihyEqO4U/n+uxKecPYeeab0z3gAwJ5EgRUhf/lw9dZ5knDYNEuuyrxgBajBzM+/zts8e7iwSJfl6HZLIPByxJOQ1wg0J6h+YhbKNLcujwki4Bcby1uLvFp6lqg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763132930; c=relaxed/simple; bh=iC+uxBQHbLQ+m2z9VraFNRSYI/qV3RWs20bwcHoB2rc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=pWRB4wDBMepmuOb82McAmm5wWPtNyi9yFlHED+ta7I6a7CS603kovj6JpO8aFYsGGvGB0Yob2J09brDJLIPQzhqMsgvAMYStnso868CyGfLRP5prK8WKfGGzi61cdaYku6lixyYM+gh7i6jat6JTMWeJnVZ4yh22+qFV3pVOWPE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=silabs.com; spf=pass smtp.mailfrom=silabs.com; dkim=pass (2048-bit key) header.d=silabs.com header.i=@silabs.com header.b=m3+TSqiH; dkim=pass (1024-bit key) header.d=silabs.com header.i=@silabs.com header.b=AI9aaXwX; arc=fail smtp.client-ip=148.163.149.154 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=silabs.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=silabs.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=silabs.com header.i=@silabs.com header.b="m3+TSqiH"; dkim=pass (1024-bit key) header.d=silabs.com header.i=@silabs.com header.b="AI9aaXwX" Received: from pps.filterd (m0101743.ppops.net [127.0.0.1]) by mx0a-0024c301.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5AE9ueVG2132744; Fri, 14 Nov 2025 09:08:42 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pps12202023; bh=r83zSysVVIma+J6xjjMea2UC8puMSeW8TAkf+SAbR7g=; b=m3+TSqiHOy2m eMF/5BB21YA+unArW+StN/t5WkGHqCKR9897unHu4TkLC/9cRwlSiGdIQfQxsoPg YBIMG8mTZTw/XDLY29ntjeOapypyuypHYh562d3n35B11EODBQr4evf1BKVIIpYh Tg1f3irZee4R5eM/wwNm3fcQK2BLrh5+8ulInndtoFO2KLg3lKt5MHMzf6Y2xO9L EDtWoAoY9evqH1Mtx31/PIpNCvfBdVVcWXO1WHFmJvRZH94XOHRPd+17hiv4SPcv 59O3YVxBvPAFDO6zahBYH5vMz5Bm2K+E06q8Cxzc5aeYEqChVxLkdCeGbaWqs8KT HniQonqh7A== Received: from cy3pr05cu001.outbound.protection.outlook.com (mail-westcentralusazon11023086.outbound.protection.outlook.com [40.93.201.86]) by mx0a-0024c301.pphosted.com (PPS) with ESMTPS id 4ae285rk2n-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 14 Nov 2025 09:08:41 -0600 (CST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tA6XyDUw3COsGa4qkAszxgu5xVXO1zldqhJeqEBcW/2kPRZsiNqg92oV9h4uauKpZNAW/rN4qDQePsaUJdTAuheXJF92GbhpSFE654ekn2f6aZGF4TY3nETVwpyLrQ2uzEeQcSOgLIoS+qrYdUOilgR5DKno+761ptwT0P/CXvUUCOEnQWj4mLtvNyKqUyyB0bBMhqFGlE+uJ2cRZeiJif4iPC3wC/tjBzVGYkamOqRSy6PvwpUBm70Dxr6Mgo2WQIK1Cm8Wm6apdphc0o3G5KcdJy7CIAgYnWhe+P26LMcxS/nzAsA+CUxw181avenfvVO7QFdSAlC3S3lC3A9RtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=r83zSysVVIma+J6xjjMea2UC8puMSeW8TAkf+SAbR7g=; b=vdW5q6kNVkiU/V9z0guDD8CN3iBIsJKXoGx/XHqFR9x0VwEdRZeuS1KNCs+SqBxcU0KafsMBpK6rMOmBRVnnMi7VhRmP8EzZtdU1KRhi2bZ15PrGM9/Lx+W71TT5vo2txD9BjDOZfVmgsV9YVvsNOrW74a7Cz5fth8lgTqP6XbOuZ/RPkhvm9juO+Y7B+OvTDCGpY9CH7pAisS6WQA1QHE7gJ6Q5XARgmi9B3evsWuQjHcevVBAIc83ej6oUtJ6ISqCpjfuecM7B/O9VRjYO9qDPLPlKsn8jKO/Pib85/gz7o1cA1SAKw1icurWVrmXdR5ETpVIq+5cSskwNy9trJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r83zSysVVIma+J6xjjMea2UC8puMSeW8TAkf+SAbR7g=; b=AI9aaXwX4TUEkeVd162ZaNrsFVquak7KT6a4wbEhyJLvciS7oXp/IFIEHB6D0HNK8QIOuIh/w3hKh95GfEhDHzLmqg5Nb9t4e8l1fcUlDqOi5kWIdvVCnMuJIrln8vH/QDAL3e0rgFUua4XBBHUPXSnsj3Jx0LA135d5oARhOGM= Received: from DS0PR11MB8205.namprd11.prod.outlook.com (2603:10b6:8:162::17) by CH3PR11MB8774.namprd11.prod.outlook.com (2603:10b6:610:1cd::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.17; Fri, 14 Nov 2025 15:08:39 +0000 Received: from DS0PR11MB8205.namprd11.prod.outlook.com ([fe80::c508:9b04:3351:524a]) by DS0PR11MB8205.namprd11.prod.outlook.com ([fe80::c508:9b04:3351:524a%5]) with mapi id 15.20.9320.018; Fri, 14 Nov 2025 15:08:39 +0000 From: =?UTF-8?q?Damien=20Ri=C3=A9gel?= To: greybus-dev@lists.linaro.org, Johan Hovold , Alex Elder , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Silicon Labs Kernel Team , =?UTF-8?q?Damien=20Ri=C3=A9gel?= Subject: [RFC PATCH v2 11/12] greybus: cpc: honour remote's RX window Date: Fri, 14 Nov 2025 10:07:37 -0500 Message-ID: <20251114150738.32426-12-damien.riegel@silabs.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251114150738.32426-1-damien.riegel@silabs.com> References: <20251114150738.32426-1-damien.riegel@silabs.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MA5P287CA0046.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:175::12) To DS0PR11MB8205.namprd11.prod.outlook.com (2603:10b6:8:162::17) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB8205:EE_|CH3PR11MB8774:EE_ X-MS-Office365-Filtering-Correlation-Id: 6cdd36ec-e37a-423b-4367-08de238fb140 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?RjdWSm5zQk5JYlprUHIyM1VzNFdURWNtVWVvUmZxZHYvWmgva0x1cFBOMTdE?= =?utf-8?B?SXlOZVk2c3ZVQ2hBRGVldHkydlY0YWFVK0lGU0xqYlNOZ1RWRjBBeW93cWlP?= =?utf-8?B?MW1vdzZOR0dqa3lvUGtVRzZMeHA5OEErM3N4Y2FySjFvTFZTSzFYT0dsb0xS?= =?utf-8?B?SXNqYUhhTDlQMTBONkJIYXBQMlM3UWExeEhhZjh3NjJCMzJNS1NFNVdnZ1dw?= =?utf-8?B?a2RwMU5NbGJiRVU5RVBjcGU4UW9waUxyLzMycHI5d0VacThkSklJRXZnZXk1?= =?utf-8?B?aDVXNXpPeCt6NUYwbkY2dFphTHFBVFo4anhtb2dhbmI0Q2k1SUo5QU05TXNL?= =?utf-8?B?NUkrWkVwNVJSYU14YXBnNlM3b0h4QUxRZnhscHVraXp5bExnSEV5d0E0cDJF?= =?utf-8?B?N1dKajNXcnNlNG4zdW5zSlU0OGJHeitpM1loTm92cEVLeU9HNDZLaHovMVN2?= =?utf-8?B?Z0lGRFV6ckRlRDdkR0h6eXUwWjRoQ0xleVNpOEo0cTJCcWpqSC9KV1Bmd2sw?= =?utf-8?B?SHJ2WCt0VExLK0RVYzEwQ1lmZFZDbndjcVpDUHpoMzdMSmoxbmxlRTY1cGpn?= =?utf-8?B?M1ZaKzQxY1FXTSt2bmQyc1FQeVdaSWg2cE9BNmdkcFBxOVFBZDhzRmxQcVVB?= =?utf-8?B?RTREOFVnd0pTS3Q5aGNIRVlGaUQrMVNxclJqUWxyMEJXbkJNWENTN24vTUx5?= =?utf-8?B?Y0pkTUNZc1hSL1NEKzV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sdFlRM0UvVEVtUW4zOUVlRXNJSCtxQ3FuZHc3VWxHVWI5YmFucjFXNWc4?= =?utf-8?B?Mm5kK2toaXNpelprbmtHcHNjRnY1WVgxb0pzT3pkSUJyMm5sVVVuVTlyN0tx?= =?utf-8?B?Zit2bFV2LytBNHMzcGUvaDcvaXBiMVFDVkhhNjBFZ2xxdzUxazZzSTlWTkpq?= =?utf-8?B?OUZMY2o4VDQrVTliSjU5R2xQN3g0MzVKd2xHYkt3VDJYb0pkaFJZSmdNVXpJ?= =?utf-8?B?NXlJWGs5cm82QVAyM1FobExQWk9xS3JkcGsyNmc2WUpyZTA4SHlUeSszSmpT?= =?utf-8?B?a1MyM1JrVHM3ZVBEOVJQM0Z5a3hmUkU4R3oxZmdoWEl6bG5DNnNYU0Fab3J5?= =?utf-8?B?Q0JBdytYNWVSOG9tc2Zlb3ZJOGkvcmlQenc2bU4wcUthMW42N1RpOWx1NkRm?= =?utf-8?Q?ggsNrQ?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB8205.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aG5aS2h5V0dCSnZoSUZrc1lSK1FrUHNpSEtEVlRTUU5aa3FTRUJrNy8wSElz?= =?utf-8?B?Y2tqeDBzTWxvbkZwRzB4Wmp3RDg5Rk1FaE56VU56T0tCZDFrZ2pJcUR1RU5n?= =?utf-8?B?azdhdytxSWMydWZmcXlQdlpYdGdLSjBFNXJtT01aV1RGYmNVUTA3enhQVXJE?= =?utf-8?B?UUNCSWp4UmhSTko0UVpNTTgxWmdZMEJrY1F6Q2gzMDd2cXJucHFmNlNQclhK?= =?utf-8?B?bjVMdUlPWFNIQ0FiRisxcWw0Wllj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aG9mZ1FoRExpd2M4QnJ3Q2NFbnVWMjM1QTUvMSt3LzRLbjdQSVVqOWtjUVU0?= =?utf-8?Q?Jknno1aQSmGK/Z9k6XtwpuSEF?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6cdd36ec-e37a-423b-4367-08de238fb140 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB8205.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2025 15:08:39.7992 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LOiZQGHMrvPpgP5Szn4ZcQyxw0QmIaTFBVbbiwuvQg2SUUUkNhw8BbzvbScezVLW7BJwYD/o4F86Wo2JLhtbGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB8774 X-Proofpoint-ORIG-GUID: NPEVGuybaaiijM6i1fJgYKwiZ6mTwqzG X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE0MDEyMSBTYWx0ZWRfX396+AU+MntbK sVwlnVeszLdZEQ1caggJCehrEMPzrErT9/Le0w/h1M5uqlsE8s7Lfh5IZB6keo/RIeSweeWmhBq mOG1ZKFBW3dgE4O5QbepluId8UgDYFP3Y4Zo49YXGrOP/V0ecYDxMsgWIVGf0JG/oiGReNFlZ/J a4cprA3EmTuHdSId5lha3ecFGBUTTLgVuFjLsnpZnTUo+AcXSo8RWWEd9piVhCfG9QzAj3Tny/p xf+Mw/RJ9f2+qrhUsxfYSV8rw3O9vu8TBcxA/we7lN2HRqZKwYlsDYwh8ZNTr0lXSgYe/N9kb0i RScaOi+7wCwPmB0Qhk5Lz7cJVwClM+tk8+sPX6tmtjnr9jzuISxzsOytNYgA3efPeRDSwMpQhAt XQbBX1TPnqjIutfph7ODT43wDoCFEA== X-Proofpoint-GUID: NPEVGuybaaiijM6i1fJgYKwiZ6mTwqzG X-Authority-Analysis: v=2.4 cv=LfAxKzfi c=1 sm=1 tr=0 ts=691745f9 cx=c_pps a=abZUFfWgJRaQ0xfFFz1/lg==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=M51BFTxLslgA:10 a=i1IsUcr2s-wA:10 a=VkNPw1HP01LnGYTKEx00:22 a=2AEO0YjSAAAA:8 a=LxIw55J96KH0fPlZK-gA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=cPQSjfK2_nFv0Q5t_7PE:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-14_04,2025-11-13_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 phishscore=0 priorityscore=1501 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511140121 The RX window indicates how many reception buffers the peer has available for that cport. The other peer must not send more messages than that window, or the chances of those messages being lost is very high, leading to retransmissions and poor performance. The RX window is associated with the ack number, and indicates the valid range of sequence number the other peer can use: Ack RX window Valid Sequence Range X 0 None X 1 X X 2 X -> X+1 So everytime an ack is received, the driver evaluates if the valid sequence range has changed and if so pops message from its holding queue. As the skb is moved to another queue, it cannot be passed directly to the lower layer anymore, instead a clone is passed. Signed-off-by: Damien Ri=C3=A9gel --- drivers/greybus/cpc/cpc.h | 9 ++++ drivers/greybus/cpc/cport.c | 5 ++ drivers/greybus/cpc/header.c | 88 ++++++++++++++++++++++++++++++++++ drivers/greybus/cpc/header.h | 6 +++ drivers/greybus/cpc/host.c | 9 ---- drivers/greybus/cpc/host.h | 1 - drivers/greybus/cpc/protocol.c | 72 +++++++++++++++++++++++++--- 7 files changed, 173 insertions(+), 17 deletions(-) diff --git a/drivers/greybus/cpc/cpc.h b/drivers/greybus/cpc/cpc.h index d5ad3b0846f..7c1b48f52ff 100644 --- a/drivers/greybus/cpc/cpc.h +++ b/drivers/greybus/cpc/cpc.h @@ -19,6 +19,7 @@ * @cpc_hd: pointer to the CPC host device this cport belongs to * @lock: mutex to synchronize accesses to tcb and other attributes * @holding_queue: list of frames queued to be sent + * @retx_queue: list of frames sent and waiting for acknowledgment * @tcb: Transmission Control Block */ struct cpc_cport { @@ -28,12 +29,20 @@ struct cpc_cport { struct mutex lock; /* Synchronize access to state variables */ =20 struct sk_buff_head holding_queue; + struct sk_buff_head retx_queue; =20 /* + * @send_wnd: send window, maximum number of frames that the remote can a= ccept. + * TX frames should have a sequence in the range [send_una; se= nd_una + send_wnd] + * @send_nxt: send next, the next sequence number that will be used for t= ransmission + * @send_una: send unacknowledged, the oldest unacknowledged sequence num= ber * @ack: current acknowledge number * @seq: current sequence number */ struct { + u8 send_wnd; + u8 send_nxt; + u8 send_una; u8 ack; u8 seq; } tcb; diff --git a/drivers/greybus/cpc/cport.c b/drivers/greybus/cpc/cport.c index f850da7acfb..2f37bd035b6 100644 --- a/drivers/greybus/cpc/cport.c +++ b/drivers/greybus/cpc/cport.c @@ -16,6 +16,9 @@ static void cpc_cport_tcb_reset(struct cpc_cport *cport) { cport->tcb.ack =3D 0; cport->tcb.seq =3D 0; + cport->tcb.send_nxt =3D 0; + cport->tcb.send_una =3D 0; + cport->tcb.send_wnd =3D 1; } =20 /** @@ -38,12 +41,14 @@ struct cpc_cport *cpc_cport_alloc(u16 cport_id, gfp_t g= fp_mask) =20 mutex_init(&cport->lock); skb_queue_head_init(&cport->holding_queue); + skb_queue_head_init(&cport->retx_queue); =20 return cport; } =20 void cpc_cport_release(struct cpc_cport *cport) { + skb_queue_purge(&cport->retx_queue); skb_queue_purge(&cport->holding_queue); kfree(cport); } diff --git a/drivers/greybus/cpc/header.c b/drivers/greybus/cpc/header.c index 973883c1d5c..650fbaacc8c 100644 --- a/drivers/greybus/cpc/header.c +++ b/drivers/greybus/cpc/header.c @@ -22,6 +22,17 @@ bool cpc_header_is_control(const struct cpc_header *hdr) return hdr->ctrl_flags & CPC_HEADER_CONTROL_IS_CONTROL_MASK; } =20 +/** + * cpc_header_get_recv_wnd() - Get the receive window. + * @hdr: CPC header. + * + * Return: Receive window. + */ +u8 cpc_header_get_recv_wnd(const struct cpc_header *hdr) +{ + return hdr->recv_wnd; +} + /** * cpc_header_get_seq() - Get the sequence number. * @hdr: CPC header. @@ -33,6 +44,17 @@ u8 cpc_header_get_seq(const struct cpc_header *hdr) return hdr->seq; } =20 +/** + * cpc_header_get_ack() - Get the acknowledge number. + * @hdr: CPC header. + * + * Return: Acknowledge number. + */ +u8 cpc_header_get_ack(const struct cpc_header *hdr) +{ + return hdr->ack; +} + /** * cpc_header_get_req_ack() - Get the request acknowledge frame flag. * @hdr: CPC header. @@ -56,3 +78,69 @@ u8 cpc_header_encode_ctrl_flags(bool control, bool req_a= ck) return FIELD_PREP(CPC_HEADER_CONTROL_IS_CONTROL_MASK, control) | FIELD_PREP(CPC_HEADER_CONTROL_REQ_ACK_MASK, req_ack); } + +/** + * cpc_header_get_frames_acked_count() - Get frames to be acknowledged. + * @seq: Current sequence number of the endpoint. + * @ack: Acknowledge number of the received frame. + * + * Return: Frames to be acknowledged. + */ +u8 cpc_header_get_frames_acked_count(u8 seq, u8 ack) +{ + u8 frames_acked_count; + + /* Find number of frames acknowledged with ACK number. */ + if (ack > seq) { + frames_acked_count =3D ack - seq; + } else { + frames_acked_count =3D 256 - seq; + frames_acked_count +=3D ack; + } + + return frames_acked_count; +} + +/** + * cpc_header_number_in_window() - Test if a number is within a window. + * @start: Start of the window. + * @end: Window size. + * @n: Number to be tested. + * + * Given the start of the window and its size, test if the number is + * in the range [start; start + wnd). + * + * @return True if start <=3D n <=3D start + wnd - 1 (modulo 256), otherwi= se false. + */ +bool cpc_header_number_in_window(u8 start, u8 wnd, u8 n) +{ + u8 end; + + if (wnd =3D=3D 0) + return false; + + end =3D start + wnd - 1; + + return cpc_header_number_in_range(start, end, n); +} + +/** + * cpc_header_number_in_range() - Test if a number is between start and en= d (included). + * @start: Lowest limit. + * @end: Highest limit inclusively. + * @n: Number to be tested. + * + * @return True if start <=3D n <=3D end (modulo 256), otherwise false. + */ +bool cpc_header_number_in_range(u8 start, u8 end, u8 n) +{ + if (end >=3D start) { + if (n < start || n > end) + return false; + } else { + if (n > end && n < start) + return false; + } + + return true; +} diff --git a/drivers/greybus/cpc/header.h b/drivers/greybus/cpc/header.h index 5ac431b3c54..79635077511 100644 --- a/drivers/greybus/cpc/header.h +++ b/drivers/greybus/cpc/header.h @@ -41,8 +41,14 @@ struct cpc_header { #define CPC_HEADER_SIZE (sizeof(struct cpc_header)) =20 bool cpc_header_is_control(const struct cpc_header *hdr); +u8 cpc_header_get_recv_wnd(const struct cpc_header *hdr); u8 cpc_header_get_seq(const struct cpc_header *hdr); +u8 cpc_header_get_ack(const struct cpc_header *hdr); bool cpc_header_get_req_ack(const struct cpc_header *hdr); u8 cpc_header_encode_ctrl_flags(bool control, bool req_ack); =20 +u8 cpc_header_get_frames_acked_count(u8 seq, u8 ack); +bool cpc_header_number_in_window(u8 start, u8 wnd, u8 n); +bool cpc_header_number_in_range(u8 start, u8 end, u8 n); + #endif diff --git a/drivers/greybus/cpc/host.c b/drivers/greybus/cpc/host.c index 27f02120266..0f9aa394690 100644 --- a/drivers/greybus/cpc/host.c +++ b/drivers/greybus/cpc/host.c @@ -200,15 +200,6 @@ void cpc_hd_del(struct cpc_host_device *cpc_hd) } EXPORT_SYMBOL_GPL(cpc_hd_del); =20 -void cpc_hd_message_sent(struct sk_buff *skb, int status) -{ - struct cpc_host_device *cpc_hd =3D CPC_SKB_CB(skb)->cport->cpc_hd; - struct gb_host_device *hd =3D cpc_hd->gb_hd; - - greybus_message_sent(hd, CPC_SKB_CB(skb)->gb_message, status); -} -EXPORT_SYMBOL_GPL(cpc_hd_message_sent); - void cpc_hd_rcvd(struct cpc_host_device *cpc_hd, struct sk_buff *skb) { struct gb_operation_msg_hdr *gb_hdr; diff --git a/drivers/greybus/cpc/host.h b/drivers/greybus/cpc/host.h index a3d6ddb648e..07bb4eb5fb8 100644 --- a/drivers/greybus/cpc/host.h +++ b/drivers/greybus/cpc/host.h @@ -46,7 +46,6 @@ int cpc_hd_add(struct cpc_host_device *cpc_hd); void cpc_hd_put(struct cpc_host_device *cpc_hd); void cpc_hd_del(struct cpc_host_device *cpc_hd); void cpc_hd_rcvd(struct cpc_host_device *cpc_hd, struct sk_buff *skb); -void cpc_hd_message_sent(struct sk_buff *skb, int status); =20 int cpc_hd_send_skb(struct cpc_host_device *cpc_hd, struct sk_buff *skb); =20 diff --git a/drivers/greybus/cpc/protocol.c b/drivers/greybus/cpc/protocol.c index 272eafd79b0..13c5b921b50 100644 --- a/drivers/greybus/cpc/protocol.c +++ b/drivers/greybus/cpc/protocol.c @@ -15,7 +15,7 @@ static bool cpc_skb_is_sequenced(struct sk_buff *skb) return CPC_SKB_CB(skb)->cpc_flags & CPC_SKB_FLAG_REQ_ACK; } =20 -static void cpc_protocol_prepare_header(struct sk_buff *skb, u8 ack) +static void cpc_protocol_prepare_header(struct sk_buff *skb, u8 ack, u8 re= cv_window) { struct cpc_header *hdr; =20 @@ -23,7 +23,7 @@ static void cpc_protocol_prepare_header(struct sk_buff *s= kb, u8 ack) =20 hdr =3D (struct cpc_header *)skb->data; hdr->ack =3D ack; - hdr->recv_wnd =3D 0; + hdr->recv_wnd =3D recv_window; hdr->seq =3D CPC_SKB_CB(skb)->seq; hdr->ctrl_flags =3D cpc_header_encode_ctrl_flags(!CPC_SKB_CB(skb)->gb_mes= sage, cpc_skb_is_sequenced(skb)); @@ -47,11 +47,46 @@ static void cpc_protocol_queue_ack(struct cpc_cport *cp= ort, u8 ack) gb_hdr->size =3D sizeof(*gb_hdr); cpc_cport_pack(gb_hdr, cport->id); =20 - cpc_protocol_prepare_header(skb, ack); + cpc_protocol_prepare_header(skb, ack, CPC_HEADER_MAX_RX_WINDOW); =20 cpc_hd_send_skb(cport->cpc_hd, skb); } =20 +static void __cpc_protocol_receive_ack(struct cpc_cport *cport, u8 recv_wn= d, u8 ack) +{ + struct gb_host_device *gb_hd =3D cport->cpc_hd->gb_hd; + struct sk_buff *skb; + u8 acked_frames; + + cport->tcb.send_wnd =3D recv_wnd; + + skb =3D skb_peek(&cport->retx_queue); + if (!skb) + return; + + /* Return if no frame to ACK. */ + if (!cpc_header_number_in_range(cport->tcb.send_una, cport->tcb.send_nxt,= ack)) + return; + + /* Calculate how many frames will be ACK'd. */ + acked_frames =3D cpc_header_get_frames_acked_count(CPC_SKB_CB(skb)->seq, = ack); + + for (u8 i =3D 0; i < acked_frames; i++) { + skb =3D skb_dequeue(&cport->retx_queue); + if (!skb) { + dev_err_ratelimited(cpc_hd_dev(cport->cpc_hd), "pending ack queue short= er than expected"); + break; + } + + if (CPC_SKB_CB(skb)->gb_message) + greybus_message_sent(gb_hd, CPC_SKB_CB(skb)->gb_message, 0); + + kfree_skb(skb); + + cport->tcb.send_una++; + } +} + void cpc_protocol_on_data(struct cpc_cport *cport, struct sk_buff *skb) { struct cpc_header *cpc_hdr =3D (struct cpc_header *)skb->data; @@ -62,6 +97,10 @@ void cpc_protocol_on_data(struct cpc_cport *cport, struc= t sk_buff *skb) =20 mutex_lock(&cport->lock); =20 + __cpc_protocol_receive_ack(cport, + cpc_header_get_recv_wnd(cpc_hdr), + cpc_header_get_ack(cpc_hdr)); + if (require_ack) { expected_seq =3D seq =3D=3D cport->tcb.ack; if (expected_seq) @@ -74,6 +113,8 @@ void cpc_protocol_on_data(struct cpc_cport *cport, struc= t sk_buff *skb) =20 ack =3D cport->tcb.ack; =20 + __cpc_protocol_write_head(cport); + mutex_unlock(&cport->lock); =20 /* Ack no matter if the sequence was valid or not, to resync with remote = */ @@ -87,9 +128,10 @@ void cpc_protocol_on_data(struct cpc_cport *cport, stru= ct sk_buff *skb) } } =20 -static void __cpc_protocol_write_skb(struct cpc_cport *cport, struct sk_bu= ff *skb, u8 ack) +static void __cpc_protocol_write_skb(struct cpc_cport *cport, struct sk_bu= ff *skb, + u8 ack, u8 recv_window) { - cpc_protocol_prepare_header(skb, ack); + cpc_protocol_prepare_header(skb, ack, recv_window); =20 cpc_hd_send_skb(cport->cpc_hd, skb); } @@ -98,14 +140,30 @@ static void __cpc_protocol_write_skb(struct cpc_cport = *cport, struct sk_buff *sk void __cpc_protocol_write_head(struct cpc_cport *cport) { struct sk_buff *skb; - u8 ack; + u8 ack, send_una, send_wnd; =20 ack =3D cport->tcb.ack; + send_una =3D cport->tcb.send_una; + send_wnd =3D cport->tcb.send_wnd; =20 /* For each SKB in the holding queue, clone it and pass it to lower layer= */ while ((skb =3D skb_peek(&cport->holding_queue))) { + struct sk_buff *out_skb; + + /* Skip this skb if it must be acked but the remote has no room for it. = */ + if (!cpc_header_number_in_window(send_una, send_wnd, CPC_SKB_CB(skb)->se= q)) + break; + + /* Clone and send out the skb */ + out_skb =3D skb_clone(skb, GFP_KERNEL); + if (!out_skb) + return; + skb_unlink(skb, &cport->holding_queue); =20 - __cpc_protocol_write_skb(cport, skb, ack); + __cpc_protocol_write_skb(cport, out_skb, ack, CPC_HEADER_MAX_RX_WINDOW); + + cport->tcb.send_nxt++; + skb_queue_tail(&cport->retx_queue, skb); } } --=20 2.49.0