MAC_FILTER(9E) | Driver Entry Points | MAC_FILTER(9E) |
mac_filter
,
mgi_addmac
, mgi_remmac
,
mgi_addvlan
, mgi_remvlan
— add and remove filters from MAC groups
#include
<sys/mac_provider.h>
int
prefix_ring_add_mac
(mac_group_driver_t
driver, const uint8_t *mac);
int
prefix_ring_rem_mac
(mac_group_driver_t
driver, const uint8_t *mac);
int
prefix_ring_add_vlan
(mac_group_driver_t
driver, uint16_t vlan);
int
prefix_ring_rem_vlan
(mac_group_driver_t
driver, uint16_t vlan);
Uncommitted - This interface is still evolving. API and ABI stability is not guaranteed.
ETHERADDRL
.The
mac_filter
()
family of entry points are used to add and remove various classes of filters
from a device. For more information on the filters, see the
Filters section of
mac_capab_rings(9E) and the
discussion around setting these members in
mac_group_info(9S).
The driver argument indicates which group the request to add or remove a filter is being requested on.
The filter addition operations,
mgi_addmac
(),
mgi_addvlan
(), and
mgi_addmvf
(),
all instruct the system to add a filter to the specified group. The filter
should not target any specific ring in the group. If multiple rings are
present, then the driver should ensure that the hardware balances incoming
traffic amongst all of the rings through a consistent hashing mechanism such
as receive side scaling.
The
mgi_addmac
()
entry point instructs the driver to add the MAC address specified in
mac to the filter list for the group. The MAC address
should always be a unicast MAC address; however, the driver is encouraged to
verify that before adding it.
The
mgi_remmac
()
should remove the MAC address specified in mac from
the filter list for the group.
The
mgi_addvlan
()
entry point instructs the driver to add the VLAN specified in
vlan to the filter list for the group. The
mgi_remvlan
()
entry point instructs the driver to remove the VLAN specified in
vlan from the filter list for the group.
Multiple filters of the same class should always be treated as a logical-OR. The frame may match any of the filters in a given class to be accepted. Filters of different classes should always be treated as a logical-AND. The frame must match a filter in all programmed classes to be accepted. For more information, see the Filters section of mac_capab_rings(9E).
Upon successful completion, the driver should ensure that the filter has been added or removed and return 0. Otherwise, it should return the appropriate error number.
The device driver may return one of the following errors. While this list is not intended to be exhaustive, it is recommended to use one of these if possible.
EEXIST
EINVAL
EIO
ENOENT
ENOTSUP
ENOSPC
mac(9E), mac_capab_rings(9E), mr_gget(9E), mac_group_info(9S)
July 17, 2023 | OmniOS |