This RFC describes a proposed change in the ethdev API for updating
the set of multicast MAC addresses that are filtered by a port.

The change consists in adding a new function "update_mc_addr_list" that
takes the whole set of multicast MAC addresses to be filtered by a port,
if any.

In case the whole set of multicast addresses is too large for the device
resources used to record them, the ethdev function "update_mc_addr_list" 
must transparently enable the allmulticast feature of the port, if such 
a feature is supported/enabled by the device.

Reason for Change
-----------------

With the current ethdev API, the receipt of multicast packets on a given 
port can only be enabled by invoking the "rte_eth_allmulticast_enable()" 
function.
This approach may not work on Virtual Functions in SR-IOV architectures
when the host PF driver does not allow this operation on VFs.
In such a case, joined multicast addresses must be individually added 
into the set of multicast MAC addresses that are filtered by the [VF] port.

For this purpose, a new function "update_mc_addr_list()" must be 
introduced into the set of functions exported by a Poll Mode Driver.
Each time a DPDK application joins (respectively leaves) an IP multicast
group, it must add (respectively remove) the associated multicast MAC 
address from the set of multicast address to be filtered, and invoke the 
function "update_mc_addr_list()" with the updated list of multicast 
addresses on each relevant port.

Proposed API extension
----------------------

The new function "update_mc_addr_list" is added into the "eth_dev_ops"
data structure:

typedef int (*eth_update_mc_addr_list_t)(struct rte_eth_dev *dev,
                                         struct ether_addr *mc_addr_set,
                                         uint32_t nb_mc_addr);

It is exported through the following new function:

/**
  * Update the set of multicast addresses to filter on an Ethernet device.
  *
  * @param port_id
  *   The port identifier of the Ethernet device.
  * @param mc_addr_set
  *   The array of multicast addresses to filter. Equal to NULL when the 
function
  *   is invoked to flush all multicast MAC addresses filtered by the port.
  * @param nb_mc_addr
  *   The number of multicast addresses in the *mc_addr_set* array. 
Equal to 0
  *   when the function is invoked to flush the set of multicast MAC 
addresses.
  * @return
  *   - (0) if successful.
  *   - (-ENOTSUP) if hardware doesn't support multicast filtering.
  *   - (-ENODEV) if *port_id* invalid.
  */
int rte_eth_dev_update_mc_addr_list(uint8_t port_id,
                                    struct ether_addr *mc_addr_set,
                                    uint32_t nb_mc_addr);

-- 
Ivan Boule
6WIND Development Engineer

Reply via email to