static int hns3_get_sset_count(struct net_device *netdev, int stringset)
 {
        struct hnae3_handle *h = hns3_get_handle(netdev);
-       const struct hnae3_ae_ops *ops = h->ae_algo->ops;
+       const struct hnae3_ae_ops *ops = hns3_get_ops(h);
 
        if (!ops->get_sset_count)
                return -EOPNOTSUPP;
 static void hns3_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
 {
        struct hnae3_handle *h = hns3_get_handle(netdev);
-       const struct hnae3_ae_ops *ops = h->ae_algo->ops;
+       const struct hnae3_ae_ops *ops = hns3_get_ops(h);
        int i;
 
        if (!ops->get_strings)
 static void hns3_get_ksettings(struct hnae3_handle *h,
                               struct ethtool_link_ksettings *cmd)
 {
-       const struct hnae3_ae_ops *ops = h->ae_algo->ops;
+       const struct hnae3_ae_ops *ops = hns3_get_ops(h);
 
        /* 1.auto_neg & speed & duplex from cmd */
        if (ops->get_ksettings_an_result)
                                      const struct ethtool_link_ksettings *cmd)
 {
        struct hnae3_handle *handle = hns3_get_handle(netdev);
-       const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
+       const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
        u8 module_type = HNAE3_MODULE_TYPE_UNKNOWN;
        u8 media_type = HNAE3_MEDIA_TYPE_UNKNOWN;
        u32 lane_num;
 {
        struct hnae3_handle *handle = hns3_get_handle(netdev);
        struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
-       const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
+       const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
        int ret;
 
        /* Chip don't support this mode. */
        enum hnae3_reset_type rst_type = HNAE3_NONE_RESET;
        struct hnae3_handle *h = hns3_get_handle(netdev);
        struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(h);
-       const struct hnae3_ae_ops *ops = h->ae_algo->ops;
+       const struct hnae3_ae_ops *ops = hns3_get_ops(h);
        const struct hns3_reset_type_map *rst_type_map;
        enum ethtool_reset_flags rst_flags;
        u32 i, size;
 static int hns3_nway_reset(struct net_device *netdev)
 {
        struct hnae3_handle *handle = hns3_get_handle(netdev);
-       const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
+       const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
        struct phy_device *phy = netdev->phydev;
        int autoneg;
 
 {
        struct hnae3_handle *handle = hns3_get_handle(netdev);
        struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
-       const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
+       const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
 
        if (!hnae3_ae_dev_fec_stats_supported(ae_dev) || !ops->get_fec_stats)
                return;
 {
        struct hnae3_handle *handle = hns3_get_handle(netdev);
        struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
-       const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
+       const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
        u8 fec_ability;
        u8 fec_mode;
 
 {
        struct hnae3_handle *handle = hns3_get_handle(netdev);
        struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
-       const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
+       const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
        u32 fec_mode;
 
        if (!test_bit(HNAE3_DEV_SUPPORT_FEC_B, ae_dev->caps))
 
        struct hnae3_handle *handle = hns3_get_handle(netdev);
        struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
-       const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
+       const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
        struct hns3_sfp_type sfp_type;
        int ret;
 
 {
        struct hnae3_handle *handle = hns3_get_handle(netdev);
        struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(handle);
-       const struct hnae3_ae_ops *ops = handle->ae_algo->ops;
+       const struct hnae3_ae_ops *ops = hns3_get_ops(handle);
 
        if (ae_dev->dev_version < HNAE3_DEVICE_VERSION_V2 ||
            !ops->get_module_eeprom)