@@ -1352,6 +1352,9 @@ static void *fm10k_dfwd_add_station(struct net_device *dev,
int size, i;
u16 vid, glort;
+ if (!netif_is_macvlan(sdev))
+ return ERR_PTR(-EOPNOTSUPP);
+
/* The hardware supported by fm10k only filters on the destination MAC
* address. In order to avoid issues we only support offloading modes
* where the hardware can actually provide the functionality.
@@ -7629,6 +7629,9 @@ static void *i40e_fwd_add(struct net_device *netdev, struct net_device *vdev)
struct i40e_fwd_adapter *fwd;
int avail_macvlan, ret;
+ if (!netif_is_macvlan(vdev))
+ return ERR_PTR(-EOPNOTSUPP);
+
if ((pf->flags & I40E_FLAG_DCB_ENABLED)) {
netdev_info(netdev, "Macvlans are not supported when DCB is enabled\n");
return ERR_PTR(-EINVAL);
@@ -9938,6 +9938,9 @@ static void *ixgbe_fwd_add(struct net_device *pdev, struct net_device *vdev)
int tcs = adapter->hw_tcs ? : 1;
int pool, err;
+ if (!netif_is_macvlan(vdev))
+ return ERR_PTR(-EOPNOTSUPP);
+
if (adapter->xdp_prog) {
e_warn(probe, "L2FW offload is not supported with XDP\n");
return ERR_PTR(-EINVAL);