Re: [Linuxptp-devel] kernel crashed when run linux ptp

2014-04-11 Thread Richard Cochran
On Fri, Apr 11, 2014 at 01:50:37PM +0800, Arnold kang wrote: > Dear Richard, >thanks for your reply. as i asked ,my linux kernel is 3.0, and > my phy is DP83640, and my mac is stmmac, and my cpu is arm A9, Where did you get your kernel? I guess you have out of tree patches, right? >

Re: [Linuxptp-devel] kernel crashed when run linux ptp

2014-04-11 Thread Arnold kang
Dear Richard, i get my kernel from my chip vendor, yes, the mac driver is modified by them. maybe this is why the kernel crashed. but i really don't understand what* skb_tx_timestamp() *mean. i search in google, there is no answer, and there is no prototype in kernel or other use in kernel cod

Re: [Linuxptp-devel] kernel crashed when run linux ptp

2014-04-11 Thread Richard Cochran
On Fri, Apr 11, 2014 at 04:07:02PM +0800, Arnold kang wrote: > Dear Richard, >i get my kernel from my chip vendor, yes, the mac driver is modified by > them. maybe this is why the kernel crashed. but i really don't understand > what* skb_tx_timestamp() *mean. i search in google, there is no a

Re: [Linuxptp-devel] kernel crashed when run linux ptp

2014-04-11 Thread Arnold kang
Dear Richard, thanks your help 2014-04-11 17:26 GMT+08:00 Richard Cochran : > On Fri, Apr 11, 2014 at 04:07:02PM +0800, Arnold kang wrote: > > Dear Richard, > >i get my kernel from my chip vendor, yes, the mac driver is modified > by > > them. maybe this is why the kernel crashed. but i

[Linuxptp-devel] [PATCH 0/5] Common address struct, sendto implementation

2014-04-11 Thread Jiri Benc
As sugested by Richard, introduce a common address struct and let the transports use it. I chose struct sockaddr to hold the actual address contents, as it allows to store also an UDP port. No functional changes by this patchset, just code refactoring. Tested with UDPv4 E2E and P2P, UDPv6 E2E and

[Linuxptp-devel] [PATCH 1/5] raw: replace hard coded constants by MAC_LEN

2014-04-11 Thread Jiri Benc
Signed-off-by: Jiri Benc --- raw.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/raw.c b/raw.c index 795292fab358..2afe8a25f85a 100644 --- a/raw.c +++ b/raw.c @@ -102,14 +102,14 @@ static int raw_configure(int fd, int event, int index, mreq.mr_ifindex = i

[Linuxptp-devel] [PATCH 4/5] Common type holding an address

2014-04-11 Thread Jiri Benc
This modifies all transports to use a new common address type, struct address. This address is stored in a ptp_message for all received messages. For sending, the "default" address is used with the default sending functions, transport_send and transport_peer. The default address depends on the tra

[Linuxptp-devel] [PATCH 3/5] Let transport_recv/send/peer use ptp_message

2014-04-11 Thread Jiri Benc
The callers of those functions are all using ptp_message. As we're going to return more information (the address), let those functions just fill in the ptp_message fields directly. Some minor reshuffling needed to prevent circular header dependencies. Signed-off-by: Jiri Benc --- msg.h|

[Linuxptp-devel] [PATCH 5/5] Implement transport_sendto

2014-04-11 Thread Jiri Benc
Also, document transport_send, transport_peer and transport_sendto usage. Signed-off-by: Jiri Benc --- transport.c |8 transport.h | 33 + 2 files changed, 41 insertions(+), 0 deletions(-) diff --git a/transport.c b/transport.c index 25d569607f71..

[Linuxptp-devel] [PATCH 2/5] raw: separate src and dst addresses

2014-04-11 Thread Jiri Benc
In order to be able to convert to a generic address struct, separate source and destination address into separate fields. Signed-off-by: Jiri Benc --- ether.h | 13 ++--- raw.c | 22 +++--- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/ether.h b/e

Re: [Linuxptp-devel] [PATCH v2 03/27] Allow sending to a specified (unicast) address

2014-04-11 Thread Jiri Benc
On Sat, 5 Apr 2014 12:40:20 +0200, Richard Cochran wrote: > Let us introduce a struct to hold addresses, something like: > > struct address { > uint8_t buf[MAXADDR]; > socklen_t len; > } > > In that way we won't need to add 'addr' and 'len' all over the pla

Re: [Linuxptp-devel] [PATCH 3/5] Let transport_recv/send/peer use ptp_message

2014-04-11 Thread Richard Cochran
On Fri, Apr 11, 2014 at 12:25:53PM +0200, Jiri Benc wrote: > The callers of those functions are all using ptp_message. As we're going to > return more information (the address), let those functions just fill in the > ptp_message fields directly. No, no, no, this violates the transport abstraction.

Re: [Linuxptp-devel] [PATCH 4/5] Common type holding an address

2014-04-11 Thread Richard Cochran
On Fri, Apr 11, 2014 at 12:25:54PM +0200, Jiri Benc wrote: > This modifies all transports to use a new common address type, struct > address. This address is stored in a ptp_message for all received messages. > > For sending, the "default" address is used with the default sending > functions, tran

Re: [Linuxptp-devel] [PATCH 2/5] raw: separate src and dst addresses

2014-04-11 Thread Richard Cochran
On Fri, Apr 11, 2014 at 12:25:52PM +0200, Jiri Benc wrote: > In order to be able to convert to a generic address struct, separate source > and destination address into separate fields. > > Signed-off-by: Jiri Benc > --- > ether.h | 13 ++--- > raw.c | 22 +++--- > 2

Re: [Linuxptp-devel] [PATCH 5/5] Implement transport_sendto

2014-04-11 Thread Richard Cochran
On Fri, Apr 11, 2014 at 12:25:55PM +0200, Jiri Benc wrote: > Also, document transport_send, transport_peer and transport_sendto usage. > > Signed-off-by: Jiri Benc > --- > transport.c |8 > transport.h | 33 + > 2 files changed, 41 insertions(+), 0

Re: [Linuxptp-devel] [PATCH 4/5] Common type holding an address

2014-04-11 Thread Jiri Benc
On Fri, 11 Apr 2014 14:08:16 +0200, Richard Cochran wrote: > > +struct address { > > + socklen_t len; > > + union { > > + struct sockaddr_storage ss; > > + struct sockaddr_in sin; > > + struct sockaddr_in6 sin6; > > + struct sockaddr_un sun; > > +

Re: [Linuxptp-devel] [PATCH 2/5] raw: separate src and dst addresses

2014-04-11 Thread Jiri Benc
On Fri, 11 Apr 2014 14:15:15 +0200, Richard Cochran wrote: > > +typedef uint8_t eth_addr[MAC_LEN]; > > Nit: I don't like this typedef for the reasons explained in the kernel > CodingStyle. I don't like it either but the other option was struct eth_addr { uint8_t addr[MAC_LEN]; }; which

Re: [Linuxptp-devel] [PATCH 3/5] Let transport_recv/send/peer use ptp_message

2014-04-11 Thread Jiri Benc
On Fri, 11 Apr 2014 14:05:58 +0200, Richard Cochran wrote: > No, no, no, this violates the transport abstraction. The transport > code knows nothing about the PTP payload, on purpose. And this is not changed by this patch. The actual transport code (udp.c, etc.) knows nothing about ptp_message. T

Re: [Linuxptp-devel] [PATCH 3/5] Let transport_recv/send/peer use ptp_message

2014-04-11 Thread Richard Cochran
On Fri, Apr 11, 2014 at 06:10:03PM +0200, Jiri Benc wrote: > > We could surely make yet another wrapper around transport_send etc. (as > you also suggest in your reply to patch 5) but I don't really see a > point of a wrapper of wrapper, especially when the inner wrapper won't > be used by anythin

Re: [Linuxptp-devel] [PATCH 4/5] Common type holding an address

2014-04-11 Thread Richard Cochran
On Fri, Apr 11, 2014 at 06:13:22PM +0200, Jiri Benc wrote: > > It's the first member of the union. I originally had only struct > sockaddr_storage here but it led to horrible typecasting in the code > (which is quite error prone when you accidentally put an extra & before > the variable). In the e