Message ID | 20210929155334.12454-20-shenjian15@huawei.com (mailing list archive) |
---|---|
State | RFC |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: extend the netdev_features_t | expand |
On 29/09/2021 16:51, Jian Shen wrote: > For the origin type for netdev_features_t would be changed to > be unsigned long * from u64, so changes the prototype of > xxx_supported_features for adaption. > > Signed-off-by: Jian Shen <shenjian15@huawei.com> > --- > drivers/net/ethernet/sfc/falcon/net_driver.h | 5 +++-- > drivers/net/ethernet/sfc/mcdi_filters.c | 5 ++++- > drivers/net/ethernet/sfc/net_driver.h | 5 +++-- > 3 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/ethernet/sfc/falcon/net_driver.h b/drivers/net/ethernet/sfc/falcon/net_driver.h > index a381cf9ec4f3..6fabfe7f02f5 100644 > --- a/drivers/net/ethernet/sfc/falcon/net_driver.h > +++ b/drivers/net/ethernet/sfc/falcon/net_driver.h > @@ -1298,11 +1298,12 @@ static inline struct ef4_rx_buffer *ef4_rx_buffer(struct ef4_rx_queue *rx_queue, > * If a feature is fixed, it does not present in hw_features, but > * always in features. > */ > -static inline netdev_features_t ef4_supported_features(const struct ef4_nic *efx) > +static inline void ef4_supported_features(const struct ef4_nic *efx, > + netdev_features_t *supported) Looks like this function isn't used anywhere in the Falcon code anyway, so you could just delete it instead. -ed
diff --git a/drivers/net/ethernet/sfc/falcon/net_driver.h b/drivers/net/ethernet/sfc/falcon/net_driver.h index a381cf9ec4f3..6fabfe7f02f5 100644 --- a/drivers/net/ethernet/sfc/falcon/net_driver.h +++ b/drivers/net/ethernet/sfc/falcon/net_driver.h @@ -1298,11 +1298,12 @@ static inline struct ef4_rx_buffer *ef4_rx_buffer(struct ef4_rx_queue *rx_queue, * If a feature is fixed, it does not present in hw_features, but * always in features. */ -static inline netdev_features_t ef4_supported_features(const struct ef4_nic *efx) +static inline void ef4_supported_features(const struct ef4_nic *efx, + netdev_features_t *supported) { const struct net_device *net_dev = efx->net_dev; - return net_dev->features | net_dev->hw_features; + *supported = net_dev->features | net_dev->hw_features; } /* Get the current TX queue insert index. */ diff --git a/drivers/net/ethernet/sfc/mcdi_filters.c b/drivers/net/ethernet/sfc/mcdi_filters.c index 1523be77b9db..8e788c3a6f2a 100644 --- a/drivers/net/ethernet/sfc/mcdi_filters.c +++ b/drivers/net/ethernet/sfc/mcdi_filters.c @@ -1298,6 +1298,7 @@ int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool multicast_chaining) { struct net_device *net_dev = efx->net_dev; struct efx_mcdi_filter_table *table; + netdev_features_t supported; int rc; if (!efx_rwsem_assert_write_locked(&efx->filter_sem)) @@ -1319,7 +1320,9 @@ int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool multicast_chaining) rc = efx_mcdi_filter_table_probe_matches(efx, table, true); if (rc) goto fail; - if ((efx_supported_features(efx) & NETIF_F_HW_VLAN_CTAG_FILTER) && + + efx_supported_features(efx, &supported); + if ((supported & NETIF_F_HW_VLAN_CTAG_FILTER) && !(efx_mcdi_filter_match_supported(table, false, (EFX_FILTER_MATCH_OUTER_VID | EFX_FILTER_MATCH_LOC_MAC)) && efx_mcdi_filter_match_supported(table, false, diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index f6981810039d..bf962ca160e7 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h @@ -1681,11 +1681,12 @@ efx_channel_tx_old_fill_level(struct efx_channel *channel) * If a feature is fixed, it does not present in hw_features, but * always in features. */ -static inline netdev_features_t efx_supported_features(const struct efx_nic *efx) +static inline void efx_supported_features(const struct efx_nic *efx, + netdev_features_t *supported) { const struct net_device *net_dev = efx->net_dev; - return net_dev->features | net_dev->hw_features; + *supported = net_dev->features | net_dev->hw_features; } /* Get the current TX queue insert index. */
For the origin type for netdev_features_t would be changed to be unsigned long * from u64, so changes the prototype of xxx_supported_features for adaption. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- drivers/net/ethernet/sfc/falcon/net_driver.h | 5 +++-- drivers/net/ethernet/sfc/mcdi_filters.c | 5 ++++- drivers/net/ethernet/sfc/net_driver.h | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-)