From: "Jérôme Pouiller" <jerome.pouiller@silabs.com>
To: greybus-dev@lists.linaro.org, "Johan Hovold" <johan@kernel.org>,
"Alex Elder" <elder@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org,
"Damien Riégel" <damien.riegel@silabs.com>
Cc: "Silicon Labs Kernel Team" <linux-devel@silabs.com>,
"Damien Riégel" <damien.riegel@silabs.com>
Subject: Re: [PATCH v2 08/14] greybus: cpc: add and validate sequence numbers
Date: Thu, 15 Jan 2026 22:46:21 +0100 [thread overview]
Message-ID: <5094501.Icojqenx9y@nb0018864> (raw)
In-Reply-To: <20260115155808.36102-9-damien.riegel@silabs.com>
On Thursday 15 January 2026 16:58:01 Central European Standard Time Damien Riégel wrote:
> The first step in making the CPC header actually do something is to add
> the sequence number to outgoing messages and validate that incoming
> frames are received in order.
>
> At this stage, the driver doesn't send standalone acks, so if a message
> with Sequence X is received, the remote will not be acknowledged until a
> message targeting that CPort comes from the Greybus layer. Only then the
> driver will ack with acknowledgedment number of X + 1.
>
> Signed-off-by: Damien Riégel <damien.riegel@silabs.com>
> ---
> Changes in v2:
> - change dev_warn to ratelimited version in cpc_protocol_on_data
>
> drivers/greybus/cpc/Makefile | 2 +-
> drivers/greybus/cpc/cpc.h | 20 +++++++++++++++
> drivers/greybus/cpc/cport.c | 25 ++++++++++++++++++
> drivers/greybus/cpc/header.c | 17 ++++++++++++
> drivers/greybus/cpc/header.h | 2 ++
> drivers/greybus/cpc/host.c | 13 +++++++---
> drivers/greybus/cpc/protocol.c | 47 ++++++++++++++++++++++++++++++++++
> 7 files changed, 121 insertions(+), 5 deletions(-)
> create mode 100644 drivers/greybus/cpc/header.c
> create mode 100644 drivers/greybus/cpc/protocol.c
>
[...]
> diff --git a/drivers/greybus/cpc/protocol.c b/drivers/greybus/cpc/protocol.c
> new file mode 100644
> index 00000000000..ff65757b40f
> --- /dev/null
> +++ b/drivers/greybus/cpc/protocol.c
> @@ -0,0 +1,47 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2025, Silicon Laboratories, Inc.
> + */
> +
> +#include <linux/skbuff.h>
> +
> +#include "cpc.h"
> +#include "header.h"
> +#include "host.h"
> +
> +void cpc_protocol_prepare_header(struct sk_buff *skb, u8 ack)
> +{
> + struct cpc_header *hdr;
> +
> + skb_push(skb, sizeof(*hdr));
> +
> + hdr = (struct cpc_header *)skb->data;
> + hdr->ack = ack;
> + hdr->recv_wnd = 0;
> + hdr->ctrl_flags = 0;
> + hdr->seq = CPC_SKB_CB(skb)->seq;
I suggest "memset(hdr, 0, sizeof(*hdr))", so there is no doubts all the
members are set.
[...]
--
Jérôme Pouiller
next prev parent reply other threads:[~2026-01-15 21:46 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-15 15:57 [PATCH v2 00/14] greybus: introduce CPC as transport layer Damien Riégel
2026-01-15 15:57 ` [PATCH v2 01/14] greybus: cpc: add minimal CPC Host Device infrastructure Damien Riégel
2026-01-16 15:11 ` Greg Kroah-Hartman
2026-01-27 21:11 ` Damien Riégel
2026-01-15 15:57 ` [PATCH v2 02/14] greybus: cpc: introduce CPC cport structure Damien Riégel
2026-01-15 15:57 ` [PATCH v2 03/14] greybus: cpc: use socket buffers instead of gb_message in TX path Damien Riégel
2026-01-15 15:57 ` [PATCH v2 04/14] greybus: cpc: pack cport ID in Greybus header Damien Riégel
2026-01-15 15:57 ` [PATCH v2 05/14] greybus: cpc: switch RX path to socket buffers Damien Riégel
2026-01-15 15:57 ` [PATCH v2 06/14] greybus: cpc: introduce CPC header structure Damien Riégel
2026-01-15 21:46 ` Jérôme Pouiller
2026-01-15 15:58 ` [PATCH v2 07/14] greybus: cpc: account for CPC header size in RX and TX path Damien Riégel
2026-01-15 15:58 ` [PATCH v2 08/14] greybus: cpc: add and validate sequence numbers Damien Riégel
2026-01-15 21:46 ` Jérôme Pouiller [this message]
2026-01-15 15:58 ` [PATCH v2 09/14] greybus: cpc: acknowledge all incoming messages Damien Riégel
2026-01-15 15:58 ` [PATCH v2 10/14] greybus: cpc: use holding queue instead of sending out immediately Damien Riégel
2026-01-15 15:58 ` [PATCH v2 11/14] greybus: cpc: honour remote's RX window Damien Riégel
2026-01-15 15:58 ` [PATCH v2 12/14] greybus: cpc: let host device drivers dequeue TX frames Damien Riégel
2026-01-15 15:58 ` [PATCH v2 13/14] greybus: cpc: add private data pointer in CPC Host Device Damien Riégel
2026-01-15 15:58 ` [PATCH v2 14/14] greybus: cpc: add CPC SDIO host driver Damien Riégel
2026-01-15 21:46 ` Jérôme Pouiller
2026-01-15 22:34 ` Jérôme Pouiller
2026-01-15 21:46 ` [PATCH v2 00/14] greybus: introduce CPC as transport layer Jérôme Pouiller
2026-01-15 22:48 ` Jérôme Pouiller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5094501.Icojqenx9y@nb0018864 \
--to=jerome.pouiller@silabs.com \
--cc=damien.riegel@silabs.com \
--cc=elder@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=greybus-dev@lists.linaro.org \
--cc=johan@kernel.org \
--cc=linux-devel@silabs.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®