@@ -1125,7 +1125,7 @@ int tls_set_device_offload(struct sock *sk, struct tls_context *ctx)
goto disable_cad;
}
- if (!(netdev->features & NETIF_F_HW_TLS_TX)) {
+ if (!netdev_feature_test_bit(NETIF_F_HW_TLS_TX_BIT, netdev->features)) {
rc = -EOPNOTSUPP;
goto release_netdev;
}
@@ -1200,7 +1200,7 @@ int tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx)
return -EINVAL;
}
- if (!(netdev->features & NETIF_F_HW_TLS_RX)) {
+ if (!netdev_feature_test_bit(NETIF_F_HW_TLS_RX_BIT, netdev->features)) {
rc = -EOPNOTSUPP;
goto release_netdev;
}
@@ -1361,7 +1361,8 @@ static int tls_dev_event(struct notifier_block *this, unsigned long event,
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
if (!dev->tlsdev_ops &&
- !(dev->features & (NETIF_F_HW_TLS_RX | NETIF_F_HW_TLS_TX)))
+ !netdev_feature_test_bits(NETIF_F_HW_TLS_RX | NETIF_F_HW_TLS_TX,
+ dev->features))
return NOTIFY_DONE;
switch (event) {
@@ -1369,7 +1370,8 @@ static int tls_dev_event(struct notifier_block *this, unsigned long event,
case NETDEV_FEAT_CHANGE:
if (netif_is_bond_master(dev))
return NOTIFY_DONE;
- if ((dev->features & NETIF_F_HW_TLS_RX) &&
+ if (netdev_feature_test_bit(NETIF_F_HW_TLS_RX_BIT,
+ dev->features) &&
!dev->tlsdev_ops->tls_dev_resync)
return NOTIFY_BAD;
Use netdev_feature_xxx helpers to replace the logical operation for netdev features. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- net/tls/tls_device.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)