The Configurable frame filters can be used to perform simple Destination Address filtering, Multicast Group matching, Source Address matching, and VLAN field matching. The use of the Mask register enables any field or combination of fields in the first 64 bytes to be isolated and matched. The Frame Filter Control register, shown in Table 4, allows you to enable or disable the frame filter by setting the promiscuous Mode bit which has the following functionality:
- When enabled, all good frames are marked as good.
- When disabled, only frames which match one or more of the pre-defined Destination Address filters, or the configurable frame filters are marked good.
When more than one frame filter is generated, it is necessary to write to the Frame Filter Control register. This write specifies which frame filter is being accessed before writing to any of the filter specific registers. It is then possible to enable each frame filter individually. While a particular filter is disabled, it does not match any packets. AMD recommends that frame filters are disabled prior to updating the match pattern to avoid acceptance of unexpected packets.
By default, all non-AVB frame filters are configured with all 1s in the bottom, 48 bits in both the Frame Filter Value registers, and the Frame Filter Mask Value registers. This results in a broadcast frame match, which has no effect as they are already accepted by the pre-defined Destination Address filters. After the frame filter value and mask value have been updated to the desired values, the filter should be enabled.
Figure 1 shows the reception of an error
free frame which matches against filter 0. In this example, the rx_axi_filter_tuser
is treated as a “bad frame” indicator and is asserted when you
want the frame to be dropped (that is, when an appropriate filter did not match against the
frame). When one or more filters are generated, the rx_axis_filter_tuser
bus is generated with one extra bit. For example, if four
filters are selected, rx_axis_filter_tuser
would be a 5-bit
bus. This extra bit (always the upper bit) is used to provide the “else” case. It is
asserted if any of the user-defined filters match a frame to indicate that the frame should
be dropped.
Usage of the rx_axis_filter_tuser
outputs would mean the frame is being serviced by a dedicated
output and should therefore be dropped by the else output. This is shown in the Figure 2, a good frame has matched against a
pre-defined Destination Address filter but failed to match any of the configurable
filters.
This extra bit allows the rx_axis_filter_tuser
bus to be used to directly drive FIFOs
for particular filter matches, such as VLAN priority. When the frame filter is configured in
Promiscuous Mode the rx_axis_filter_tuser
bits continue to
operate as normal.