Re: New validation test suites

2022-01-24 Thread Sebastian Huber

On 25/01/2022 01:09, Chris Johns wrote:

On 25/1/22 1:39 am, Sebastian Huber wrote:

how do we want to proceed with the integration of the new validation test suite?
At the moment it is not clear to me what issues are left to resolve and what I
can do to address them?


I believe I have been clear about what I see as being needed:

https://lists.rtems.org/pipermail/devel/2022-January/070323.html


Sorry, I don't know what I have to do next. The release process for 
rtems-central is quite clear from my point of view. We just have to 
create a release branch for RTEMS 6 and reference release branch commits 
in the submodules.


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: New validation test suites

2022-01-24 Thread Chris Johns
On 25/1/22 1:39 am, Sebastian Huber wrote:
> how do we want to proceed with the integration of the new validation test 
> suite?
> At the moment it is not clear to me what issues are left to resolve and what I
> can do to address them?

I believe I have been clear about what I see as being needed:

https://lists.rtems.org/pipermail/devel/2022-January/070323.html

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH rtems-libbsd 2/2] microblaze: Finish AXI Ethernet support

2022-01-24 Thread Sebastian Huber

On 24/01/2022 17:04, Alex White wrote:

On Thu, Jan 20, 2022 at 12:12 AM Sebastian 
Huber  wrote:

On 20/01/2022 04:54, Alex White wrote:

diff --git a/freebsd/sys/netinet/tcp_input.c b/freebsd/sys/netinet/tcp_input.c
index fc111d9c..60f9123a 100644
--- a/freebsd/sys/netinet/tcp_input.c
+++ b/freebsd/sys/netinet/tcp_input.c
@@ -721,6 +721,15 @@ tcp_input(struct mbuf **mp, int *offp, int proto)
   }
   #endif /* INET */
  
+#ifdef __rtems__

+#ifdef __MICROBLAZE__
+ /* Ensure that the TCP header is properly aligned in memory. */
+ struct tcphdr aligned_hdr;
+ memcpy(_hdr, th, sizeof(struct tcphdr));
+ th = _hdr;
+#endif
+#endif
+
   /*
* Check that TCP offset makes sense,
* pull out TCP options and adjust length.  XXX

Changes like this should not be hidden in a driver-specific patch. The
alignment changes are hacks. Why don't you fix the Ethernet frame
alignment in the network interface driver?


I have made the realization while testing fixes for this that if I
change the definition of struct tcphdr in netinet/tcp.h to include
__attribute__((packed)), GCC generates code that avoids the unaligned
memory access. This removes the need for any code to handle memory
alignment of the network headers.

I then noticed that you had some notes on what I think is this same
phenomenon at freebsd/contrib/libpcap/extract.h line 40.

Since, for example, the ip struct in netinet/ip.h is defined as packed,
shouldn't the tcphdr struct be packed, too?

In addition, struct tcphdr is being used to represent raw bytes on the
wire so it makes sense to declare it as packed so no padding is
included.

The initial solution I came up with was to change
newlib/libc/sys/rtems/include/netinet/tcp.h in newlib to add
__attribute__((packed)) to struct tcphdr . This could be added inside
an #ifdef __microblaze__ to minimize impact elsewhere. This would, of
course, diverge from FreeBSD's netinet/tcp.h.

Does that sound like a reasonable solution?


No, I would try to fix this in the network interface driver. See for 
example (freebsd/sys/dev/dwc/if_dwc.c):


static int
dwc_setup_rxbuf(struct dwc_softc *sc, int idx, struct mbuf *m)
{
bus_dma_segment_t seg;
#ifndef __rtems__
int error, nsegs;
#endif /* __rtems__ */

m_adj(m, ETHER_ALIGN);

Several other drivers use the same approach.

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH rtems-libbsd 2/2] microblaze: Finish AXI Ethernet support

2022-01-24 Thread Alex White
On Thu, Jan 20, 2022 at 12:12 AM Sebastian Huber 
 wrote:
>
> On 20/01/2022 04:54, Alex White wrote:
> > diff --git a/freebsd/sys/netinet/tcp_input.c 
> > b/freebsd/sys/netinet/tcp_input.c
> > index fc111d9c..60f9123a 100644
> > --- a/freebsd/sys/netinet/tcp_input.c
> > +++ b/freebsd/sys/netinet/tcp_input.c
> > @@ -721,6 +721,15 @@ tcp_input(struct mbuf **mp, int *offp, int proto)
> >   }
> >   #endif /* INET */
> >  
> > +#ifdef __rtems__
> > +#ifdef __MICROBLAZE__
> > + /* Ensure that the TCP header is properly aligned in memory. */
> > + struct tcphdr aligned_hdr;
> > + memcpy(_hdr, th, sizeof(struct tcphdr));
> > + th = _hdr;
> > +#endif
> > +#endif
> > +
> >   /*
> >* Check that TCP offset makes sense,
> >* pull out TCP options and adjust length.  XXX
>
> Changes like this should not be hidden in a driver-specific patch. The
> alignment changes are hacks. Why don't you fix the Ethernet frame
> alignment in the network interface driver?
>

I have made the realization while testing fixes for this that if I
change the definition of struct tcphdr in netinet/tcp.h to include
__attribute__((packed)), GCC generates code that avoids the unaligned
memory access. This removes the need for any code to handle memory
alignment of the network headers.

I then noticed that you had some notes on what I think is this same
phenomenon at freebsd/contrib/libpcap/extract.h line 40.

Since, for example, the ip struct in netinet/ip.h is defined as packed,
shouldn't the tcphdr struct be packed, too?

In addition, struct tcphdr is being used to represent raw bytes on the
wire so it makes sense to declare it as packed so no padding is
included.

The initial solution I came up with was to change
newlib/libc/sys/rtems/include/netinet/tcp.h in newlib to add
__attribute__((packed)) to struct tcphdr . This could be added inside
an #ifdef __microblaze__ to minimize impact elsewhere. This would, of
course, diverge from FreeBSD's netinet/tcp.h.

Does that sound like a reasonable solution?

Thanks,

Alex
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: New validation test suites

2022-01-24 Thread Sebastian Huber

Hello,

how do we want to proceed with the integration of the new validation 
test suite? At the moment it is not clear to me what issues are left to 
resolve and what I can do to address them?


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel