From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 ABAD854BCB for ; Tue, 27 Feb 2024 09:02:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709024562; cv=none; b=Png7S/8ABAvKr8scf5RU0hX49zckP4bWVvyudmF7tJMYKNA7w1Y04wXpCWjckG1i4/6gUOPiPA0mRxs+FCYXYZ2TsZ0+4VmltDvpZVqh2KpP/+hXmbGwqB7cAJAd+i7VoAwSuA+7gE2+s9Bl8Yom3LIMEpYgv0oCHyy1rW51BOY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709024562; c=relaxed/simple; bh=tjjn7VUHBtOLwll7FyS+3XVo+LQcNfHgZW2kSvy4R78=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lkuwbe9ckX9KYU9hUzmX9GL1yfZJWeF3X9atqVt2UxAY5YcemNK4wTGto1o2fm91W9SLP8CFEmx5eV+ZXhKHKKRVMUcngpJY3Q8sUfiwHfqEwxnhhKwEuBYazXOSoC5hTMMdDgSBLaEb4kSHARd3nSHT2cJasTS+uiAJi+KjQ3Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=YsIwWfnE; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YsIwWfnE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709024559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FlpacEWacryyrIlJZOoZ2EmsNR8IKw7FDvlRQtzIliY=; b=YsIwWfnEq7ad8JV2gj72KBoF/HpMcsDty3Y4F0E8dGuGQf8YWYFPLd3f8YrHkrBYKtklah hZgHKSuufMMSlQXiOitlh/cde2Y67vZmqxruOYxa7dtXhKEIBjdDrjmqtMBHv7KuWxHVWf PZrq2ktxhS0tPK+pQjR6PXoKhI7Oqs8= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-522-BldydX7HPn6KGoacEiReeA-1; Tue, 27 Feb 2024 04:02:37 -0500 X-MC-Unique: BldydX7HPn6KGoacEiReeA-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-42dd52a27f7so47517831cf.2 for ; Tue, 27 Feb 2024 01:02:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709024557; x=1709629357; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FlpacEWacryyrIlJZOoZ2EmsNR8IKw7FDvlRQtzIliY=; b=c0cfb4pDq3GEuyyGUk9Vn0m/EWc/H1Uvz6fdE3sz1x51u/KCvmzsBbWJzIkTE4ZTDC OG7VERZRwSQyUxWEwVgJgjYu84JI6gokbPVZ6mzB3xD0bvE06vQzuXZzW3nEze1uBas+ LVkvKepbtkCJslxrKOJjS1bNfRAvmYiZZL+xNWnFHbGHlepEtfI87d/KyrVnZUhk81WO UHszCqShUhfcC+mvWuXC8mEoWOHeCof9jKLx+xBxrKCd0MOaZ6y6SeMRvaCRJrUkliqD woyYv9rpQN78sVAV8HX91xzzp+ih/NVkuGvbWgNEeDr57hpkDId9veSPMwQC2BmO2PNo XsuA== X-Forwarded-Encrypted: i=1; AJvYcCW8zKnKucAzT7AO8l5LIOCxPtR1ThiT3BL2OneRgVJClLp0bGkNeSo8ZTIK5qVGoI19PMVXtDVXXiDOZxGrGnZGZ7ofpUxC95OE X-Gm-Message-State: AOJu0YwuR1KfqFzwKBmqm30jHl7i9Qzq4pzMPBgYxgO2G8oC63CY8eCI vyN8dqUDqaeZSFZ/z4K3a/dEZ3keLkBBoLmi0xEnAV4Kvypp/KZIN1YkfIj55h0hRwqYOv2qtZp eADFpHdF8OeKONkrDit7Y29PCjeIZGPTpmm9Gc314ov+gY4gep23l57r35yE2wminPw== X-Received: by 2002:ac8:7cb5:0:b0:42e:71bf:fb92 with SMTP id z21-20020ac87cb5000000b0042e71bffb92mr8237057qtv.40.1709024556892; Tue, 27 Feb 2024 01:02:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEktM+QuiKRjrNahkKKCp6g6mPsIdmLJBBljJdl/Jpj1OjlZw9vIz8CtyenrJ+CoAmXDtw3rw== X-Received: by 2002:ac8:7cb5:0:b0:42e:71bf:fb92 with SMTP id z21-20020ac87cb5000000b0042e71bffb92mr8237041qtv.40.1709024556554; Tue, 27 Feb 2024 01:02:36 -0800 (PST) Received: from fedora ([2a01:e0a:257:8c60:80f1:cdf8:48d0:b0a1]) by smtp.gmail.com with ESMTPSA id b6-20020ac87546000000b0042dce775a4bsm3405359qtr.3.2024.02.27.01.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 01:02:36 -0800 (PST) Date: Tue, 27 Feb 2024 10:02:33 +0100 From: Matias Ezequiel Vara Larsen To: Cornelia Huck Cc: Marc Kleine-Budde , Mikhail Golubev-Ciuchea , virtio-comment@lists.oasis-open.org, virtio-dev@lists.oasis-open.org, linux-can@vger.kernel.org, Harald Mommer Subject: Re: [virtio-dev] Re: [virtio-comment] [RFC PATCH v3] virtio-can: Device specification. Message-ID: References: <20230609142243.199074-1-Mikhail.Golubev-Ciuchea@opensynergy.com> <20240221-acts-decade-76d3d69e8e4d-mkl@pengutronix.de> <20240221-juggling-uproar-9518b4901f41-mkl@pengutronix.de> <877circsh3.fsf@redhat.com> Precedence: bulk X-Mailing-List: linux-can@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877circsh3.fsf@redhat.com> On Mon, Feb 26, 2024 at 01:36:40PM +0100, Cornelia Huck wrote: > On Wed, Feb 21 2024, Marc Kleine-Budde wrote: > > > On 21.02.2024 14:16:54, Matias Ezequiel Vara Larsen wrote: > >> On Wed, Feb 21, 2024 at 01:49:31PM +0100, Marc Kleine-Budde wrote: > >> > On 21.02.2024 11:37:58, Matias Ezequiel Vara Larsen wrote: > >> > > > > +The length of the \field{sdu} is determined by the \field{length}. > >> > > > > + > >> > > > > +The type of a CAN message identifier is determined by \field{flags}. The > >> > > > > +3 most significant bits of \field{can_id} do not bear the information > >> > > > > +about the type of the CAN message identifier and are 0. > >> > > > > + > >> > > > > +The device MUST reject any CAN frame type for which support has not been > >> > > > > +negotiated with VIRTIO_CAN_RESULT_NOT_OK in \field{result} and MUST NOT > >> > > > > +schedule the message for transmission. A CAN frame with an undefined bit > >> > > > > +set in \field{flags} is treated like a CAN frame for which support has > >> > > > > +not been negotiated. > >> > > > > + > >> > > > > +The device MUST reject any CAN frame for which \field{can_id} or > >> > > > > +\field{sdu} length are out of range or the CAN controller is in an > >> > > > > +invalid state with VIRTIO_CAN_RESULT_NOT_OK in \field{result} and MUST > >> > > > > +NOT schedule the message for transmission. > >> > > > > + > >> > > I am not very familiar with CAN but how does the device figure out that > >> > > the can_id is out of range? > >> > > >> > In classical CAN we have the standard CAN frames, which have an 11 bit > >> > ID, and there are extended CAN frames, which have 29 bits ID. Extended > >> > frames are signaled with VIRTIO_CAN_FLAGS_EXTENDED set. > >> > > >> > So if a standard frame uses more than 11 Bits of CAN-ID, it's considered > >> > out of range. > > > > Another option would be an extended frame (VIRTIO_CAN_FLAGS_EXTENDED > > set) and using more than 29 bits. > > > >> Thanks Marc for the explanation. Do you think that it would be > >> worthwhile to add that to the spec at some point? > > > > Yes that makes sense as it clarifies what's meant by out of range for > > CAN-IDs, for the valid length a reference to > > \item[VIRTIO_CAN_F_CAN_CLASSIC (0)] and \item[VIRTIO_CAN_F_CAN_FD (1)] > > might be added. > > [virtio mailing lists are supposedly down for migration right now, I > hope there's some kind of backfill happening later...] > > If the question comes up, it does make sense to add a > clarification... as the virtio-can spec is already voted upon and > merged, we'd need a patch on top. Not sure if it would qualify as an > editorial update or a vote would be needed, best to see it first :) > I will submit two patches regarding the changes proposed in this thread. Matias From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from ws5-mx01.kavi.com (ws5-mx01.kavi.com [34.193.7.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC5A2C54798 for ; Tue, 27 Feb 2024 09:02:52 +0000 (UTC) Received: from lists.oasis-open.org (oasis.ws5.connectedcommunity.org [10.110.1.242]) by ws5-mx01.kavi.com (Postfix) with ESMTP id 484F4120D46 for ; Tue, 27 Feb 2024 09:02:52 +0000 (UTC) Received: from lists.oasis-open.org (oasis-open.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id 3F2AF986634 for ; Tue, 27 Feb 2024 09:02:52 +0000 (UTC) Received: from host09.ws5.connectedcommunity.org (host09.ws5.connectedcommunity.org [10.110.1.97]) by lists.oasis-open.org (Postfix) with QMQP id 35F37983D68; Tue, 27 Feb 2024 09:02:52 +0000 (UTC) Mailing-List: contact virtio-comment-help@lists.oasis-open.org; run by ezmlm List-ID: Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id 1EAD3986478 for ; Tue, 27 Feb 2024 09:02:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at kavi.com X-MC-Unique: x-NwKOfmOW-bShANDLcuTg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709024557; x=1709629357; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FlpacEWacryyrIlJZOoZ2EmsNR8IKw7FDvlRQtzIliY=; b=ZFJj0GIE4w4QVgK4ILXmjz2kWEXtx6KqDxfDk/u4jFYXEIEo6xtmx1YdQYL7EgxF53 8thYVX1bGoIQQSnXnZliylnkvTTsOKXbzadygUSw/W+QpvBizDFGSaUTDnBzJ7iNrObF GRgQUR6aoxzxvtcTjxEg01kfFmdt9GpXGQQbfz3q4Koq5uXtKBl+ufkdz0iWzsZ1BeGl IbLyOHqFz7nQsGA/t/mGVUe0eFBfQl3TqK7jQ8duqhKfA0A2gVMWzHD61JK/t1yBR/3v A8CUPmGr0xVWYjkuOvgfchGYsrFDP9kitTXdGN47Su7l+SRmn6q1yJn4dgAbUW4xw7A/ 9Xig== X-Forwarded-Encrypted: i=1; AJvYcCWOksXGKtFsNHnXS5jAbCUgaWPcGciFecweY4e7DcnJ/S7LvDSob/Pufpkgc2qB04LEAt9wOOI72ignDy2NarehyhfNCHKejZT+mCPw8VHMYdIzTw== X-Gm-Message-State: AOJu0YweeD5dPNCnIigLaOuw8ZZou3VYRULW8Jvztd8XLqFjzN796Y9g 7LdrUQtnbn8xdAwBqMjp3PoSCy80SBb/s1jnop9O6kqvc8b8HaMCgjBs2rE7kHGNaqRUbw1jfcA rrunoAsMuRsnbhoaV5yu3a/tRKR8kYZ07+JAMNQskbGEkwHq9cWZcrtzssNGl+WSnYc43LxA= X-Received: by 2002:ac8:7cb5:0:b0:42e:71bf:fb92 with SMTP id z21-20020ac87cb5000000b0042e71bffb92mr8237056qtv.40.1709024556888; Tue, 27 Feb 2024 01:02:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEktM+QuiKRjrNahkKKCp6g6mPsIdmLJBBljJdl/Jpj1OjlZw9vIz8CtyenrJ+CoAmXDtw3rw== X-Received: by 2002:ac8:7cb5:0:b0:42e:71bf:fb92 with SMTP id z21-20020ac87cb5000000b0042e71bffb92mr8237041qtv.40.1709024556554; Tue, 27 Feb 2024 01:02:36 -0800 (PST) Date: Tue, 27 Feb 2024 10:02:33 +0100 From: Matias Ezequiel Vara Larsen To: Cornelia Huck Cc: Marc Kleine-Budde , Mikhail Golubev-Ciuchea , virtio-comment@lists.oasis-open.org, virtio-dev@lists.oasis-open.org, linux-can@vger.kernel.org, Harald Mommer Message-ID: References: <20230609142243.199074-1-Mikhail.Golubev-Ciuchea@opensynergy.com> <20240221-acts-decade-76d3d69e8e4d-mkl@pengutronix.de> <20240221-juggling-uproar-9518b4901f41-mkl@pengutronix.de> <877circsh3.fsf@redhat.com> MIME-Version: 1.0 In-Reply-To: <877circsh3.fsf@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [virtio-comment] Re: [virtio-dev] Re: [virtio-comment] [RFC PATCH v3] virtio-can: Device specification. On Mon, Feb 26, 2024 at 01:36:40PM +0100, Cornelia Huck wrote: > On Wed, Feb 21 2024, Marc Kleine-Budde wrote: > > > On 21.02.2024 14:16:54, Matias Ezequiel Vara Larsen wrote: > >> On Wed, Feb 21, 2024 at 01:49:31PM +0100, Marc Kleine-Budde wrote: > >> > On 21.02.2024 11:37:58, Matias Ezequiel Vara Larsen wrote: > >> > > > > +The length of the \field{sdu} is determined by the \field{length}. > >> > > > > + > >> > > > > +The type of a CAN message identifier is determined by \field{flags}. The > >> > > > > +3 most significant bits of \field{can_id} do not bear the information > >> > > > > +about the type of the CAN message identifier and are 0. > >> > > > > + > >> > > > > +The device MUST reject any CAN frame type for which support has not been > >> > > > > +negotiated with VIRTIO_CAN_RESULT_NOT_OK in \field{result} and MUST NOT > >> > > > > +schedule the message for transmission. A CAN frame with an undefined bit > >> > > > > +set in \field{flags} is treated like a CAN frame for which support has > >> > > > > +not been negotiated. > >> > > > > + > >> > > > > +The device MUST reject any CAN frame for which \field{can_id} or > >> > > > > +\field{sdu} length are out of range or the CAN controller is in an > >> > > > > +invalid state with VIRTIO_CAN_RESULT_NOT_OK in \field{result} and MUST > >> > > > > +NOT schedule the message for transmission. > >> > > > > + > >> > > I am not very familiar with CAN but how does the device figure out that > >> > > the can_id is out of range? > >> > > >> > In classical CAN we have the standard CAN frames, which have an 11 bit > >> > ID, and there are extended CAN frames, which have 29 bits ID. Extended > >> > frames are signaled with VIRTIO_CAN_FLAGS_EXTENDED set. > >> > > >> > So if a standard frame uses more than 11 Bits of CAN-ID, it's considered > >> > out of range. > > > > Another option would be an extended frame (VIRTIO_CAN_FLAGS_EXTENDED > > set) and using more than 29 bits. > > > >> Thanks Marc for the explanation. Do you think that it would be > >> worthwhile to add that to the spec at some point? > > > > Yes that makes sense as it clarifies what's meant by out of range for > > CAN-IDs, for the valid length a reference to > > \item[VIRTIO_CAN_F_CAN_CLASSIC (0)] and \item[VIRTIO_CAN_F_CAN_FD (1)] > > might be added. > > [virtio mailing lists are supposedly down for migration right now, I > hope there's some kind of backfill happening later...] > > If the question comes up, it does make sense to add a > clarification... as the virtio-can spec is already voted upon and > merged, we'd need a patch on top. Not sure if it would qualify as an > editorial update or a vote would be needed, best to see it first :) > I will submit two patches regarding the changes proposed in this thread. Matias This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC. In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting. Subscribe: virtio-comment-subscribe@lists.oasis-open.org Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org List help: virtio-comment-help@lists.oasis-open.org List archive: https://lists.oasis-open.org/archives/virtio-comment/ Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists Committee: https://www.oasis-open.org/committees/virtio/ Join OASIS: https://www.oasis-open.org/join/ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from ws5-mx01.kavi.com (ws5-mx01.kavi.com [34.193.7.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 511B0C5478C for ; Tue, 27 Feb 2024 09:02:42 +0000 (UTC) Received: from lists.oasis-open.org (oasis.ws5.connectedcommunity.org [10.110.1.242]) by ws5-mx01.kavi.com (Postfix) with ESMTP id 9EBC6C6107 for ; Tue, 27 Feb 2024 09:02:41 +0000 (UTC) Received: from lists.oasis-open.org (oasis-open.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id 84971986531 for ; Tue, 27 Feb 2024 09:02:41 +0000 (UTC) Received: from host09.ws5.connectedcommunity.org (host09.ws5.connectedcommunity.org [10.110.1.97]) by lists.oasis-open.org (Postfix) with QMQP id 6BADA9863B6; Tue, 27 Feb 2024 09:02:41 +0000 (UTC) Mailing-List: contact virtio-dev-help@lists.oasis-open.org; run by ezmlm List-ID: Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id 5C7439863DE for ; Tue, 27 Feb 2024 09:02:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at kavi.com X-MC-Unique: Osw8U546MxaX4u1xeKb5dg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709024557; x=1709629357; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FlpacEWacryyrIlJZOoZ2EmsNR8IKw7FDvlRQtzIliY=; b=aHAs9MmuOCmIi4RrPyqNC5wSyVF0AsFIIwGIBSu4jE6L5sF9mSKpuj19IoCjRzstG0 7vOv9oKxp9e2oZfOgWsDDRN+ZjMiWswZaaXAfncG8ZYNAj19PO0Q+jPjbe6ZdbfZ+/Wr +GLGHnXBbPYJslIXqse9DNhMdmuqF+4iY4qlNMiS8eVxmqhEK1nzmEtAqQV8RX5nMBt+ vuBENmpA95SShyZjiO+ysg9OzgdTx8U90O6UUP55VOe9i663Qy1IPNS+G+aHNtxPrGKk YtmEpAqyrALnROXO67d0hFJhfM3p/9QE5xHFP3crJjlko/BobEDCYab5m6IluCxdn8sk xTjg== X-Forwarded-Encrypted: i=1; AJvYcCW7ZtiKbbswnV6TZsWA6WIlBO02PpyD7Dp+8hbHYOKlV5CBUbQjIQ3knbhiBfBGv/JlZk3Ypr4k58Kjr1wFtBbXAT3WFlleaSfUd1phKJDC X-Gm-Message-State: AOJu0YygSvrB+ZonFpjBLOR7SCuLqZjyEla2UndoqalMCTkEc9YW2sIt EJFGBC8bMtu4dGn2dEPANsmPbIaw5mqS62LUmim/UFy/X5uIbVa2yc/hkzp9usbH8aqXeNPI7Nr gf09/fQzND0u7+5krazXT/lhQ8Bn98kVGhWenCG/APgCBk7jqRYZQjpqMr+gz2EsCaA== X-Received: by 2002:ac8:7cb5:0:b0:42e:71bf:fb92 with SMTP id z21-20020ac87cb5000000b0042e71bffb92mr8237053qtv.40.1709024556884; Tue, 27 Feb 2024 01:02:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEktM+QuiKRjrNahkKKCp6g6mPsIdmLJBBljJdl/Jpj1OjlZw9vIz8CtyenrJ+CoAmXDtw3rw== X-Received: by 2002:ac8:7cb5:0:b0:42e:71bf:fb92 with SMTP id z21-20020ac87cb5000000b0042e71bffb92mr8237041qtv.40.1709024556554; Tue, 27 Feb 2024 01:02:36 -0800 (PST) Date: Tue, 27 Feb 2024 10:02:33 +0100 From: Matias Ezequiel Vara Larsen To: Cornelia Huck Cc: Marc Kleine-Budde , Mikhail Golubev-Ciuchea , virtio-comment@lists.oasis-open.org, virtio-dev@lists.oasis-open.org, linux-can@vger.kernel.org, Harald Mommer Message-ID: References: <20230609142243.199074-1-Mikhail.Golubev-Ciuchea@opensynergy.com> <20240221-acts-decade-76d3d69e8e4d-mkl@pengutronix.de> <20240221-juggling-uproar-9518b4901f41-mkl@pengutronix.de> <877circsh3.fsf@redhat.com> MIME-Version: 1.0 In-Reply-To: <877circsh3.fsf@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: Re: [virtio-dev] Re: [virtio-comment] [RFC PATCH v3] virtio-can: Device specification. On Mon, Feb 26, 2024 at 01:36:40PM +0100, Cornelia Huck wrote: > On Wed, Feb 21 2024, Marc Kleine-Budde wrote: > > > On 21.02.2024 14:16:54, Matias Ezequiel Vara Larsen wrote: > >> On Wed, Feb 21, 2024 at 01:49:31PM +0100, Marc Kleine-Budde wrote: > >> > On 21.02.2024 11:37:58, Matias Ezequiel Vara Larsen wrote: > >> > > > > +The length of the \field{sdu} is determined by the \field{length}. > >> > > > > + > >> > > > > +The type of a CAN message identifier is determined by \field{flags}. The > >> > > > > +3 most significant bits of \field{can_id} do not bear the information > >> > > > > +about the type of the CAN message identifier and are 0. > >> > > > > + > >> > > > > +The device MUST reject any CAN frame type for which support has not been > >> > > > > +negotiated with VIRTIO_CAN_RESULT_NOT_OK in \field{result} and MUST NOT > >> > > > > +schedule the message for transmission. A CAN frame with an undefined bit > >> > > > > +set in \field{flags} is treated like a CAN frame for which support has > >> > > > > +not been negotiated. > >> > > > > + > >> > > > > +The device MUST reject any CAN frame for which \field{can_id} or > >> > > > > +\field{sdu} length are out of range or the CAN controller is in an > >> > > > > +invalid state with VIRTIO_CAN_RESULT_NOT_OK in \field{result} and MUST > >> > > > > +NOT schedule the message for transmission. > >> > > > > + > >> > > I am not very familiar with CAN but how does the device figure out that > >> > > the can_id is out of range? > >> > > >> > In classical CAN we have the standard CAN frames, which have an 11 bit > >> > ID, and there are extended CAN frames, which have 29 bits ID. Extended > >> > frames are signaled with VIRTIO_CAN_FLAGS_EXTENDED set. > >> > > >> > So if a standard frame uses more than 11 Bits of CAN-ID, it's considered > >> > out of range. > > > > Another option would be an extended frame (VIRTIO_CAN_FLAGS_EXTENDED > > set) and using more than 29 bits. > > > >> Thanks Marc for the explanation. Do you think that it would be > >> worthwhile to add that to the spec at some point? > > > > Yes that makes sense as it clarifies what's meant by out of range for > > CAN-IDs, for the valid length a reference to > > \item[VIRTIO_CAN_F_CAN_CLASSIC (0)] and \item[VIRTIO_CAN_F_CAN_FD (1)] > > might be added. > > [virtio mailing lists are supposedly down for migration right now, I > hope there's some kind of backfill happening later...] > > If the question comes up, it does make sense to add a > clarification... as the virtio-can spec is already voted upon and > merged, we'd need a patch on top. Not sure if it would qualify as an > editorial update or a vote would be needed, best to see it first :) > I will submit two patches regarding the changes proposed in this thread. Matias --------------------------------------------------------------------- To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org