From nobody Mon Dec 15 22:45:57 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 D90A6288CA3 for ; Fri, 12 Dec 2025 16:25:17 +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=1765556719; cv=fail; b=TDEtdH5lel9cU/jjFqBcpZq0OHsqaUSMJ0M/z/Ff6lLFi0nHVGzQZMfAwXzcCwWcpRPOEY1dZKIstnGYKAhjjPWN2ymg2RYAN7Ah/mUlAcQ/Ee9055c/EtuV4oleiywcum94YiwVUJtKvgE/Lg6H+3W80xbnEJnh9c7zx5TS7Xg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765556719; c=relaxed/simple; bh=mgGVqNGAtjmFDQo2qxqsOfeIUXqeDe3RjEKh8Z6V0XA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=p6a3lt6Gj/pMJKOSW4V45KxbiutUNE4UmDQ8uEefJSXLNg625jZPMZjhXuBecBw07pIiC/U3tc7jYZfZbMwxWi10pTQE/rSqwQZ99opaTCGuky3Q6uTpiMPl83djPHZcXANCwSVtPytUW1opZl4+N+H7isHtxcVUMr9RdI/qY70= 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=tZaa+0JJ; dkim=pass (1024-bit key) header.d=silabs.com header.i=@silabs.com header.b=BTbqc3mS; 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="tZaa+0JJ"; dkim=pass (1024-bit key) header.d=silabs.com header.i=@silabs.com header.b="BTbqc3mS" 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 5BC1HxRv2471899; Fri, 12 Dec 2025 10:13:36 -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=Tidwu4xWIuUwbRkz11CBAqSuqiDvoKTizfSYsIsn2qw=; b=tZaa+0JJrNNy 0J72IHV89p65e6BxSesMHaaag5TswfLIiGeLEqivbDUCNTDfJBXTqo0lr7EnfK6Q EWFyDOxViiVuSNP7v5cIX9KE2CjOccpvTNzTCkfEVwFBqI6CYdHAWIRTvSnZKIoz aGtoREpuAFTumfQutfzJ3VX0PEWPQXstaOIDSm3Du+bax2+0a4w9gW/7wOXo65qC FKEQEBvDFoJ/vgTYtod5K0HPvgGsTWQI+WfmctqNOkPKEVU8CYyjxUNtokcor6/t HzgxyBQjRUTqTZOj6wCxvWIEYqBgvYLCK1XDhUrKXLq973fjOuyU9qijh91YmO7W ghVGsmlA7g== Received: from cy7pr03cu001.outbound.protection.outlook.com (mail-westcentralusazon11020120.outbound.protection.outlook.com [40.93.198.120]) by mx0a-0024c301.pphosted.com (PPS) with ESMTPS id 4ayht2mdet-2 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 12 Dec 2025 10:13:36 -0600 (CST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kSuAD+8KPsYCtw3ImJbbroEXQnKRynh8av/8NuIckprSwyb5t8doqA+3P75P2PKlg0+pu22DQZdE+hq5ym1qQ+ZCackrzCknO2aRBPJC4ZbJlb9dCCRIIAV5amUdXaEc6rFJZvp9EI7CSMjZEh7g49HJEFnzQaQ6KV/zuu3yPhaJPVQsy9Vz5cjmIWHoUONTeH39TMgrYk/fe1CuaDGTrF7fUkrnD1+w4CBhKEeizJgwmR1t/lxtHjkP2b/GE9wjRrgcaeyJvFg7kLNVe2qm0Cc5H0OTyF/GB4LBWxLlUG6pHSQuJaQUYcc2KizUIlVn4dj2hqWBySXjJlBSqfmVUQ== 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=Tidwu4xWIuUwbRkz11CBAqSuqiDvoKTizfSYsIsn2qw=; b=STmpV/2YRh39jpT0F4R85nZr/3UX3Obx5Vh/QSHTtVF8sRTVeKUulYHqZXjtv5hAqeSRM7JWOto6r/d/0QSG0XQmTbniFIjBWiBYlsSAHLQtFgXq5bnLTwA2kNoGNKO2cqsb0RtytP+CAskq/KA6ETKaVFoQHZIIC+/CgKJo/yyM/9VTAjzVK4mDG7Q6U6EWZ5pSy45EPo93FnYp2VBAO5adr5MgdRRn/8llxK45xEMkbBqg9qJttYs0CET4B8yyiAWexKGotcCapgeQVk2qpDKr6dOgbUBTh+4kmntf23Rp24DoPX+qbHzue3lnopzlBgT35+676EANAj82yT4GuQ== 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=Tidwu4xWIuUwbRkz11CBAqSuqiDvoKTizfSYsIsn2qw=; b=BTbqc3mSZc9xjatB/LLoeSzwLUkPkJUmDB609gDDydOFJl/q79UhhX1DioZy84zU3O19LCqZoWAF6lImakuuBnYsKBKFL9iRCuyCCXbgXj9gWYDlBY0uWSAwkCYwWOSc6P26SoTJpINl/Vzr69Hmtklwkmk/tM0XTzYbmeXH2q4= Received: from DS0PR11MB8205.namprd11.prod.outlook.com (2603:10b6:8:162::17) by DM3PPF7468F7991.namprd11.prod.outlook.com (2603:10b6:f:fc00::f2d) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9412.9; Fri, 12 Dec 2025 16:13:30 +0000 Received: from DS0PR11MB8205.namprd11.prod.outlook.com ([fe80::2de6:bc88:2af7:3583]) by DS0PR11MB8205.namprd11.prod.outlook.com ([fe80::2de6:bc88:2af7:3583%3]) with mapi id 15.20.9412.005; Fri, 12 Dec 2025 16:13:30 +0000 From: =?UTF-8?q?Damien=20Ri=C3=A9gel?= To: greybus-dev@lists.linaro.org Cc: linux-kernel@vger.kernel.org, Johan Hovold , Alex Elder , Greg Kroah-Hartman , Silicon Labs Kernel Team , =?UTF-8?q?Damien=20Ri=C3=A9gel?= Subject: [PATCH 11/14] greybus: cpc: honour remote's RX window Date: Fri, 12 Dec 2025 11:13:05 -0500 Message-ID: <20251212161308.25678-12-damien.riegel@silabs.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20251212161308.25678-1-damien.riegel@silabs.com> References: <20251212161308.25678-1-damien.riegel@silabs.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: YQZPR01CA0176.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:8b::25) 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_|DM3PPF7468F7991:EE_ X-MS-Office365-Filtering-Correlation-Id: f2ae46be-84eb-4e6f-546d-08de399963cf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ckJha0tjZ3U5eGszdHJBZE00NGpsQ2RucWxXT1JQZlFNOEVuZkZ2S0JvWk80?= =?utf-8?B?NGVLanMwS0M0Y05XdkVnNDNxRzhhcUtvb2MxOGpmR1ZMRzFNRkY0WWFUNzhh?= =?utf-8?B?RmRuQS94MUNRVWZQUUxBcW5OY3JmQUlHMFhpUUY5R0NyejkybTN2ek03TDJp?= =?utf-8?B?NVhPMXg2Tlh6ano1VllYUU5DdGVEdjlxS0l0cVV0enRtVElsazNudnJ2TFEw?= =?utf-8?B?M3NxaGpuN1NBWi9JMFZtWm1TTnYzd3Y5VUxTTE10MTI2OGhudVUvM2ZLVHZR?= =?utf-8?B?a21adnUzbTlidHU3djd1OE1ucFFOM3hucnhRbG5wRlhpSXpZU0JjWlBiUTlU?= =?utf-8?B?QWkyYnp5RDVCb3J2TVhmTTg5TmNWRTc0TkkyRzNIS1dta1dRZ2ZXOVphZlN2?= =?utf-8?B?ZDF4K0hVY2FwQXg0Tk1WT2xRbUFaY1NFQmZsMFJGaW9saDA3cXRucTA1UGdS?= =?utf-8?B?ZndhOFlRMlErb0k3WFhtQUZPWWlLVk9FMjVQMVh6WSs5WWE4T09jZzE4Qi9J?= =?utf-8?B?Q0duWVNhdUhCYkw2V1NsL1k3YlhSVDhEUWZKc1NWdERCVjNnNitVcFkxSXVW?= =?utf-8?B?YWxIMVBXSkRxbERhK1VpV0txU05xc2pzSCtxN0pUZERNblAwSDh4MUZPNFA5?= =?utf-8?B?SGZoRHRtZEo4ZUs2cFFjTmhsMUJDVnJlUldxNGg4YkRMWXNTQ2Fram9nRVg0?= =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akpwcGhKaGtjSWhN?= =?utf-8?B?NHozaitjTm1UTzdZanZDYlpNeVp6UnNENFV3NEpKajlrTzhCQkRRMjhXemFI?= =?utf-8?B?VzhIRW5qbFRrVWVkZFNleHduUkxnUFFZYUVEdEFyelBuV0Q2MmtqbjNuSWtt?= =?utf-8?B?MmtqMTJZUW84ZnpRQkY0TStWMGVaaFJ2b0J1QlEvYmxpMVM5UGlQWDdpdSth?= =?utf-8?B?VWpFQzVPb09jM1BBNjZaeENDT0FTS2NwTDM0QXFKQytqZHpaYUpPMHFtaThF?= =?utf-8?B?QTRjVVVGWEdhTkZhOEViTHVNK3Nxc1FFMlVLU2YxaFlFckhUVVpkRk9NMW9D?= =?utf-8?B?cVJORlJGVUMxdExtUm5Da1dNb3FwWmtZbzlrTGpnaGFQbXQ2YXN5K2NLVUV1?= =?utf-8?B?UHE4bHM1KzlXckl4Z2dKT1pGUnpub2RKSW8wTllUQ25WbXpPNlk5OVgrcVB5?= =?utf-8?Q?rP2x7b?= 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)(52116014)(376014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MW9xL3BBTks4T1Z2WGVwTXR0Ly9UZDdUaDJzNzI2c3dYUDREb0lFdFhJUU5D?= =?utf-8?B?dncva3diTXMwMlluWFB1VkVTcEVldHlsb1JuekZJU29NMVk4ci9KMTgwVnc4?= =?utf-8?B?aWFmNisvS0dCWnFFMHpkV3ByYzRuRVNtRStYeGFMWUd6cDI2endtQll2SXo3?= =?utf-8?B?b2pwa2dzQ29wdGZKNlNRSG5nU0xsZ3JjRjAzalZOVGl5VzdVVnZON2dUZjAw?= =?utf-8?B?K001U0FFQjlYQk9BcDF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lEvUk9Z?= =?utf-8?B?ekgwdVVsWGJYTTdhVW5Va0k4QTFTQ0dvcnBtNVlRcTk3THlaWVFKbTkvSnpE?= =?utf-8?Q?VtncVsd7X8s7eQ3a4LjNtynh/?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2ae46be-84eb-4e6f-546d-08de399963cf X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB8205.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2025 16:13:30.2017 (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: WC7+6xILhw1DVjOc8K/5Iymi0krXuQxQCgtow31RprtKGab/RP8za+qWg11pf+/dTQeI3z66fQRGdoez34tqwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PPF7468F7991 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjEyMDEyOSBTYWx0ZWRfX0xmW6t8RV+fD PVaiU5boMNs2115eH+wlr2KuuhyIqPMjPLcfS4SuFYvktM3dNTl6UYIaQSBHDPM67ZdD9IAkyba 66ZGFrwpv9PuTHDPtcKytwEvQRLT7UaAUvZwVqWvJHvwEvFqR2UEjUUahF8Er9xjSab8x8zQkr6 7Gw0jb9xOiiQ4yJ4DAbg2vU9kSXZmPbjltvlCMuCMio+xnLiT6UKqkqgl3JkSdwDa0noTppe0uE MrSmHaEiZXGmiqxz+O7E+ovXo7YBF06nGG28enjJ37p4VHpx6rfy93N170lUejGASxsP6qctwg+ MiI2MZsPYXrWM+mVzkdHbuljRaL9x5nUtOP+tc5smW7sOxKkatWaz33/VgrCXaZvuRROSF/wKfP H+a9c94tjKea2PcJiw+iH01kePgYKw== X-Authority-Analysis: v=2.4 cv=BKy+bVQG c=1 sm=1 tr=0 ts=693c3f30 cx=c_pps a=OsHIvx7z5txkqQhXuj38dg==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=M51BFTxLslgA:10 a=i1IsUcr2s-wA:10 a=VkNPw1HP01LnGYTKEx00:22 a=2AEO0YjSAAAA:8 a=LxIw55J96KH0fPlZK-gA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-ORIG-GUID: pejU08CtYg3MSajZf0hiCs6p8-w3xpnr X-Proofpoint-GUID: pejU08CtYg3MSajZf0hiCs6p8-w3xpnr 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-12-12_04,2025-12-11_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 suspectscore=0 bulkscore=0 phishscore=0 priorityscore=1501 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2512120129 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 f1669585c45..e8cbe916630 100644 --- a/drivers/greybus/cpc/cpc.h +++ b/drivers/greybus/cpc/cpc.h @@ -18,6 +18,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 { @@ -27,12 +28,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 8875a6fed26..43038f103b5 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 0c9f6e56524..053dc3707d0 100644 --- a/drivers/greybus/cpc/header.h +++ b/drivers/greybus/cpc/header.h @@ -42,8 +42,14 @@ struct cpc_header { #define GREYBUS_HEADER_SIZE (sizeof(struct gb_operation_msg_hdr)) =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 ec43d33dfc6..a7715c0a960 100644 --- a/drivers/greybus/cpc/host.c +++ b/drivers/greybus/cpc/host.c @@ -199,15 +199,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 cc835f5298b..8f05877b2be 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 ef8ff0cac24..b5de63d0be8 100644 --- a/drivers/greybus/cpc/protocol.c +++ b/drivers/greybus/cpc/protocol.c @@ -14,7 +14,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 @@ -22,7 +22,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)); @@ -46,11 +46,47 @@ 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 shorter 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; @@ -61,6 +97,9 @@ void cpc_protocol_on_data(struct cpc_cport *cport, struct= 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) @@ -72,6 +111,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 = */ @@ -85,9 +126,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); } @@ -96,14 +138,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