#4652 closed defect (fixed)

if_atsam: Fix checksum offload, add multicast and VLAN support (cloned)

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 6.1
Component: network/libbsd Version: 5
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

Cloned from #4651:


The if_atsam network interface driver has several issues. Do not disable the FCS if the checksum offload is disabled. Make sure the interface capabilities are enabled. Add multicast and VLAN support. Use the interface transmit method instead of the interface start approach. Correct a potential receive starvation error. Fix the interface up/down.

Change History (34)

comment:1 Changed on 05/11/22 at 13:53:53 by Sebastian Huber <sebastian.huber@…>

In 2556c4c/rtems-libbsd:

if_atsam: Fix warnings

Update #4652.

comment:2 Changed on 05/11/22 at 13:53:54 by Sebastian Huber <sebastian.huber@…>

In 7e082f6/rtems-libbsd:

if_atsam: Enable all capabilities

Update #4652.

comment:3 Changed on 05/11/22 at 13:53:55 by Sebastian Huber <sebastian.huber@…>

In adda3a5/rtems-libbsd:

if_atsam: Do not disable the Ethernet CRC

The Ethernet CRC and padding must be always generated by the MAC.

Update #4652.

comment:4 Changed on 05/11/22 at 13:53:57 by Sebastian Huber <sebastian.huber@…>

In 975916a/rtems-libbsd:

if_atsam: Fix interrupt setup

The interrupt is enabled by rtems_interrupt_handler_install().

Update #4652.

comment:5 Changed on 05/11/22 at 13:53:58 by Sebastian Huber <sebastian.huber@…>

In 1230011/rtems-libbsd:

if_atsam: Fix start/stop of interface

Update #4652.

comment:6 Changed on 05/11/22 at 13:53:59 by Sebastian Huber <sebastian.huber@…>

In c944cb9/rtems-libbsd:

if_atsam: Add multicast support

Update #4652.

comment:7 Changed on 05/11/22 at 13:54:01 by Sebastian Huber <sebastian.huber@…>

In 2cb974f/rtems-libbsd:

if_atsam: Optimize transmit

Use the transmit interface handler to avoid a transmit task/interrupt.
Use a compile-time constant for the transmit DMA descriptor count to
simplify calculations.

Update #4652.

comment:8 Changed on 05/11/22 at 13:54:02 by Sebastian Huber <sebastian.huber@…>

In 967613f/rtems-libbsd:

if_atsam: Optimize receive

Do not use the interface mutex in the receive loop. Avoid multiple
reads of DMA descriptor words. Use a compile-time constant for the
receive DMA descriptor count to simplify calculations.

Update #4652.

comment:9 Changed on 05/11/22 at 13:54:03 by Sebastian Huber <sebastian.huber@…>

In 821bcb7/rtems-libbsd:

if_atsam: Support IFCAP_VLAN_HWTAGGING

This is required to enable checksum offload for vlan interfaces.

Update #4652.

comment:10 Changed on 05/11/22 at 13:54:05 by Sebastian Huber <sebastian.huber@…>

In 989675e/rtems-libbsd:

if_atsam: Do not use rtems_bsdnet_newproc()

Update #4652.

comment:11 Changed on 05/11/22 at 13:54:06 by Sebastian Huber <sebastian.huber@…>

In 4ad0961/rtems-libbsd:

if_atsam: Support transmit bpf

Update #4652.

comment:12 Changed on 05/11/22 at 13:54:07 by Sebastian Huber <sebastian.huber@…>

In e992d45/rtems-libbsd:

if_atsam: Fix interface stop

Update #4652.

comment:13 Changed on 05/11/22 at 14:01:46 by Sebastian Huber <sebastian.huber@…>

In 73c764a/rtems-libbsd:

if_atsam: Fix warnings

Update #4652.

comment:14 Changed on 05/11/22 at 14:01:48 by Sebastian Huber <sebastian.huber@…>

In c58bb60/rtems-libbsd:

if_atsam: Enable all capabilities

Update #4652.

comment:15 Changed on 05/11/22 at 14:01:49 by Sebastian Huber <sebastian.huber@…>

In 5b62a8b/rtems-libbsd:

if_atsam: Do not disable the Ethernet CRC

The Ethernet CRC and padding must be always generated by the MAC.

Update #4652.

comment:16 Changed on 05/11/22 at 14:01:50 by Sebastian Huber <sebastian.huber@…>

In 339ba3d/rtems-libbsd:

if_atsam: Fix interrupt setup

The interrupt is enabled by rtems_interrupt_handler_install().

Update #4652.

comment:17 Changed on 05/11/22 at 14:01:51 by Sebastian Huber <sebastian.huber@…>

In f4efcbf/rtems-libbsd:

if_atsam: Fix start/stop of interface

Update #4652.

comment:18 Changed on 05/11/22 at 14:01:53 by Sebastian Huber <sebastian.huber@…>

In 3150b37/rtems-libbsd:

if_atsam: Add multicast support

Update #4652.

comment:19 Changed on 05/11/22 at 14:01:54 by Sebastian Huber <sebastian.huber@…>

In 6be24bd/rtems-libbsd:

if_atsam: Optimize transmit

Use the transmit interface handler to avoid a transmit task/interrupt.
Use a compile-time constant for the transmit DMA descriptor count to
simplify calculations.

Update #4652.

comment:20 Changed on 05/11/22 at 14:01:55 by Sebastian Huber <sebastian.huber@…>

In 62fc2b6/rtems-libbsd:

if_atsam: Optimize receive

Do not use the interface mutex in the receive loop. Avoid multiple
reads of DMA descriptor words. Use a compile-time constant for the
receive DMA descriptor count to simplify calculations.

Update #4652.

comment:21 Changed on 05/11/22 at 14:01:56 by Sebastian Huber <sebastian.huber@…>

In 202502a/rtems-libbsd:

if_atsam: Support IFCAP_VLAN_HWTAGGING

This is required to enable checksum offload for vlan interfaces.

Update #4652.

comment:22 Changed on 05/11/22 at 14:01:58 by Sebastian Huber <sebastian.huber@…>

In 5c4ac7a/rtems-libbsd:

if_atsam: Do not use rtems_bsdnet_newproc()

Update #4652.

comment:23 Changed on 05/11/22 at 14:01:59 by Sebastian Huber <sebastian.huber@…>

In 8039d70/rtems-libbsd:

if_atsam: Support transmit bpf

Update #4652.

comment:24 Changed on 05/11/22 at 14:02:00 by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: assignedclosed

In 38e1610/rtems-libbsd:

if_atsam: Fix interface stop

Close #4652.

comment:25 Changed on 06/01/22 at 07:52:38 by Sebastian Huber <sebastian.huber@…>

In 07e2820/rtems-libbsd:

if_atsam: Allow stats reset via sysctl

Update #4652.

comment:26 Changed on 06/01/22 at 07:52:39 by Sebastian Huber <sebastian.huber@…>

In 683bae9/rtems-libbsd:

if_atsam: Add register sysctls

Update #4652.

comment:27 Changed on 06/01/22 at 07:52:40 by Sebastian Huber <sebastian.huber@…>

In bd56cb2/rtems-libbsd:

if_atsam: Add tx/rx desc sysctls

Update #4652.

comment:28 Changed on 06/01/22 at 07:52:42 by Sebastian Huber <sebastian.huber@…>

In 8588e95/rtems-libbsd:

if_atsam: Shorten sysctl names

Update #4652.

comment:29 Changed on 06/01/22 at 07:52:43 by Sebastian Huber <sebastian.huber@…>

In 61f646d/rtems-libbsd:

if_atsam: Recover from receive freezes

Under unknown conditions the receive path ended up in a frozen state.
In this state, the DMA and driver descriptor head were equal and all
receive descriptors had the used bit set. So, the DMA was unable to
store received frames. However, the receive daemon was never woken up
to refill the receive buffers. It seems that the RXUBR interrupt can be
used to recover from this state.

Update #4652.

comment:30 Changed on 06/01/22 at 07:53:41 by Sebastian Huber <sebastian.huber@…>

In 5650e92/rtems-libbsd:

if_atsam: Allow stats reset via sysctl

Update #4652.

comment:31 Changed on 06/01/22 at 07:53:42 by Sebastian Huber <sebastian.huber@…>

In eb58e82/rtems-libbsd:

if_atsam: Add register sysctls

Update #4652.

comment:32 Changed on 06/01/22 at 07:53:43 by Sebastian Huber <sebastian.huber@…>

In 1ed12b8/rtems-libbsd:

if_atsam: Add tx/rx desc sysctls

Update #4652.

comment:33 Changed on 06/01/22 at 07:53:45 by Sebastian Huber <sebastian.huber@…>

In eea3f0e/rtems-libbsd:

if_atsam: Shorten sysctl names

Update #4652.

comment:34 Changed on 06/01/22 at 07:53:46 by Sebastian Huber <sebastian.huber@…>

In 9e87868/rtems-libbsd:

if_atsam: Recover from receive freezes

Under unknown conditions the receive path ended up in a frozen state.
In this state, the DMA and driver descriptor head were equal and all
receive descriptors had the used bit set. So, the DMA was unable to
store received frames. However, the receive daemon was never woken up
to refill the receive buffers. It seems that the RXUBR interrupt can be
used to recover from this state.

Update #4652.

Note: See TracTickets for help on using tickets.