From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Werner Subject: Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller driver Date: Thu, 11 Aug 2016 10:58:26 +0200 Message-ID: <20160811085826.GB25813@awelinux> References: <20160726091555.GA26227@awelinux> <9487fe77-dbd0-3a64-b648-cf76b897feda@grandegger.com> <20160808113938.GA17459@awelinux> <456c4f82-6a53-e821-3396-63d413db9eb7@grandegger.com> <20160808140546.GA1733@awelinux> <808e919b-8643-2113-9fde-001861883abe@grandegger.com> <20160809061038.GC1733@awelinux> <20160811071458.GA25813@awelinux> <1d81436b-4ad2-a34f-e2e1-accde0b16a47@hartkopp.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Received: from mail1.bemta5.messagelabs.com ([195.245.231.152]:36290 "EHLO mail1.bemta5.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752408AbcHKI7O (ORCPT ); Thu, 11 Aug 2016 04:59:14 -0400 Content-Disposition: inline In-Reply-To: <1d81436b-4ad2-a34f-e2e1-accde0b16a47@hartkopp.net> Sender: linux-can-owner@vger.kernel.org List-ID: To: Oliver Hartkopp Cc: Andreas Werner , Wolfgang Grandegger , mkl@pengutronix.de, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, jthumshirn@suse.de, andy@wernerandy.de, michael.miehling@men.de On Thu, Aug 11, 2016 at 10:45:00AM +0200, Oliver Hartkopp wrote: > On 08/11/2016 09:14 AM, Andreas Werner wrote: > >On Wed, Aug 10, 2016 at 10:28:45PM +0200, Oliver Hartkopp wrote: > > >>Just check 'git grep IFF_ECHO'. Even grcan.c and janz-ican3.c have IFF_ECHO > >>set - but implement it in a different way without using the provided > >>machanism from dev.c . > >> > > > >Ok I am with you. > > Great :-) > > >>A local loopback inside the CAN controller which is generated after > >>successful transmit is an excellent implementation with excellent > >>timestamps. The only problem for you is to detect the looped CAN frames and > >>match them to the skb pointer of the outgoing frame to 'receive' the correct > >>echo skb. > >> > > > >At the moment, i think there is no way to detect those looped frames. > >I will talk to our IC designer and discuss this issue with him. Maybe we > >have the possibility to get a local loopback inside the CAN controller. > >This seems to be the best way to do it. > > When you still have the possibility to change the IP core I would suggest to > create some kind of 16/32 bit value which you can pass to the CAN controller > along with the CAN frame to be sent. > > And when this frame comes back due to the loopback you can use this non-zero > 16/32 bit value to match into a list of tx skb pointers for IFF_ECHO. > > E.g. when this 16/32 bit value is zero this CAN frame obviously was received > from another CAN node. > > Just an idea. > I am not sure if we have a way to change the IP but i will try to talk with my IC designer. He will be available next week. Your idea sounds good. I will check a few more driver to get more information how they did the implementation. > Regards, > Oliver Thanks your comments and explanations Oliver. Regards Andy From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932811AbcHKI7o (ORCPT ); Thu, 11 Aug 2016 04:59:44 -0400 Received: from mail1.bemta5.messagelabs.com ([195.245.231.152]:36290 "EHLO mail1.bemta5.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752408AbcHKI7O (ORCPT ); Thu, 11 Aug 2016 04:59:14 -0400 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFKsWRWlGSWpSXmKPExsUS8J9toq6J3Zp wgzPHhSxWXdvBaDHnfAuLxeOuGawWq75PZba4vGsOm8X6RVNYLI4tELO48eofu8XSeztZHTg9 tqy8yeTx8dJtRo/m/0fYPfr/GnhsPl3t8XmTnEf/pYeMAexRrJl5SfkVCawZe9ffZizo56voX HiHpYFxIXcXIxeHkEADo8Tfn9tZuxg5OSQE/CT6ZvxghEjMZ5RY/vcWO0iCRUBVYsfnzWBFbA I6Eufam8FsESB74b+nzCANzAKLmCS2n7nNBJIQFgiR6D95gRnE5hXQlWj61MMMMfUYs8TSO+/ YIBKCEidnPmEBsZmBJi3Y/QkozgFkS0ss/8cBEuYUcJB4fa+PESQsKqAi8epgPUhYSEBJ4vOL PmaIo+Ul9vYtBuuUEIiT+HLHFMK0lpi4OXECo/AsJKtmIVk1C2HVAkbmVYwaxalFZalFukaWe klFmekZJbmJmTm6hgamermpxcWJ6ak5iUnFesn5uZsYgXFWz8DAuIPx8ha/Q4ySHExKorzCMa vDhfiS8lMqMxKLM+KLSnNSiw8xynBwKEnw/rZZEy4kWJSanlqRlpkDjHiYtAQHj5IIr54tUJq 3uCAxtzgzHSJ1ilFRSpxXHiQhAJLIKM2Da4MlmUuMslLCvIwMDAxCPAWpRbmZJajyrxjFORiV hHkNQabwZOaVwE1/BbSYCWjxCTOwxSWJCCmpBsb5syeH6xgoeS9dIfnbpfaNy5d9L9N8pK+8W bM8/9lKdss9r/+feLSYbZGExLNF8w5sm7Pf6JNEemvnlVyjqt0frJfc2/klcfaGz02/eRquel hMX9IqP13BKC/nb8nOluKqu23nAr/5PEhiecPkctT2W+ja1zvvSp8UPbVSdNGdSJGfLve5pOd WKrEUZyQaajEXFScCACYhqQYtAwAA X-Env-Sender: Andreas.Werner@men.de X-Msg-Ref: server-2.tower-178.messagelabs.com!1470905907!53573584!1 X-Originating-IP: [80.255.6.145] X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked X-PGP-Universal: processed; by keys.men.de on Thu, 11 Aug 2016 10:58:28 +0200 Date: Thu, 11 Aug 2016 10:58:26 +0200 From: Andreas Werner To: Oliver Hartkopp CC: Andreas Werner , Wolfgang Grandegger , , , , , , , , Subject: Re: [PATCH RESEND] net: can: Introduce MEN 16Z192-00 CAN controller driver Message-ID: <20160811085826.GB25813@awelinux> References: <20160726091555.GA26227@awelinux> <9487fe77-dbd0-3a64-b648-cf76b897feda@grandegger.com> <20160808113938.GA17459@awelinux> <456c4f82-6a53-e821-3396-63d413db9eb7@grandegger.com> <20160808140546.GA1733@awelinux> <808e919b-8643-2113-9fde-001861883abe@grandegger.com> <20160809061038.GC1733@awelinux> <20160811071458.GA25813@awelinux> <1d81436b-4ad2-a34f-e2e1-accde0b16a47@hartkopp.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1d81436b-4ad2-a34f-e2e1-accde0b16a47@hartkopp.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [192.1.1.170] X-ClientProxiedBy: MEN-EX01.intra.men.de (192.168.1.1) To MEN-EX01.intra.men.de (192.168.1.1) X-EXCLAIMER-MD-CONFIG: e4841e51-7998-49c0-ba41-8b8a0e2d8962 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 11, 2016 at 10:45:00AM +0200, Oliver Hartkopp wrote: > On 08/11/2016 09:14 AM, Andreas Werner wrote: > >On Wed, Aug 10, 2016 at 10:28:45PM +0200, Oliver Hartkopp wrote: > > >>Just check 'git grep IFF_ECHO'. Even grcan.c and janz-ican3.c have IFF_ECHO > >>set - but implement it in a different way without using the provided > >>machanism from dev.c . > >> > > > >Ok I am with you. > > Great :-) > > >>A local loopback inside the CAN controller which is generated after > >>successful transmit is an excellent implementation with excellent > >>timestamps. The only problem for you is to detect the looped CAN frames and > >>match them to the skb pointer of the outgoing frame to 'receive' the correct > >>echo skb. > >> > > > >At the moment, i think there is no way to detect those looped frames. > >I will talk to our IC designer and discuss this issue with him. Maybe we > >have the possibility to get a local loopback inside the CAN controller. > >This seems to be the best way to do it. > > When you still have the possibility to change the IP core I would suggest to > create some kind of 16/32 bit value which you can pass to the CAN controller > along with the CAN frame to be sent. > > And when this frame comes back due to the loopback you can use this non-zero > 16/32 bit value to match into a list of tx skb pointers for IFF_ECHO. > > E.g. when this 16/32 bit value is zero this CAN frame obviously was received > from another CAN node. > > Just an idea. > I am not sure if we have a way to change the IP but i will try to talk with my IC designer. He will be available next week. Your idea sounds good. I will check a few more driver to get more information how they did the implementation. > Regards, > Oliver Thanks your comments and explanations Oliver. Regards Andy