Re: [PATCH v2 net-next] net/core: generic support for disabling netdev features down stack

From: Nikolay Aleksandrov
Date: Tue Nov 03 2015 - 05:03:22 EST


On 11/03/2015 03:55 AM, Jarod Wilson wrote:
[snip]
>
> +#define for_each_netdev_feature(mask_addr, feature) \
> + int bit; \
> + for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT) \
> + feature = __NETIF_F_BIT(bit);
> +
^
This is broken, it will not work for more than a single feature.

> /* Features valid for ethtool to change */
> /* = all defined minus driver/device-class-related */
> #define NETIF_F_NEVER_CHANGE (NETIF_F_VLAN_CHALLENGED | \
> @@ -167,6 +172,12 @@ enum {
> */
> #define NETIF_F_ALL_FOR_ALL (NETIF_F_NOCACHE_COPY | NETIF_F_FSO)
>
> +/*
> + * If upper/master device has these features disabled, they must be disabled
> + * on all lower/slave devices as well.
> + */
> +#define NETIF_F_UPPER_DISABLES NETIF_F_LRO
> +
[snip]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/