/* 0x00 group must be only the first */ if (group_id_new == 0) returntrue; /* 0xFF group is compatible with anything else */ if (group_id_new == 0xFF || group_id_old == 0xFF) returnfalse; /* otherwise only profiles from the same group are compatible*/ return group_id_old != group_id_new;
}
/* Check if profile data already exists*/
istatus = i40e_ddp_does_profile_exist(&pf->hw, &pinfo); if (istatus < 0) {
netdev_err(netdev, "Failed to fetch loaded profiles."); return istatus;
} if (is_add) { if (istatus > 0) {
netdev_err(netdev, "DDP profile already loaded."); return -EINVAL;
}
istatus = i40e_ddp_does_profile_overlap(&pf->hw, &pinfo); if (istatus < 0) {
netdev_err(netdev, "Failed to fetch loaded profiles."); return istatus;
} if (istatus > 0) {
netdev_err(netdev, "DDP profile overlaps with existing one."); return -EINVAL;
}
} else { if (istatus == 0) {
netdev_err(netdev, "DDP profile for deletion does not exist."); return -EINVAL;
}
}
/* Load profile data */ if (is_add) {
status = i40e_write_profile(&pf->hw, profile_hdr, track_id); if (status) { if (status == -ENODEV) {
netdev_err(netdev, "Profile is not supported by the device."); return -EPERM;
}
netdev_err(netdev, "Failed to write DDP profile."); return -EIO;
}
} else {
status = i40e_rollback_profile(&pf->hw, profile_hdr, track_id); if (status) {
netdev_err(netdev, "Failed to remove DDP profile."); return -EIO;
}
}
/* Add/remove profile to/from profile list in FW */ if (is_add) {
status = i40e_add_pinfo(&pf->hw, profile_hdr, profile_info_sec,
track_id); if (status) {
netdev_err(netdev, "Failed to add DDP profile info."); return -EIO;
}
} else {
status = i40e_del_pinfo(&pf->hw, profile_hdr, profile_info_sec,
track_id); if (status) {
netdev_err(netdev, "Failed to restore DDP profile info."); return -EIO;
}
}
/* Check for valid region first */ if (flash->region != I40_DDP_FLASH_REGION) {
netdev_err(netdev, "Requested firmware region is not recognized by this driver."); return -EINVAL;
} if (pf->hw.bus.func != 0) {
netdev_err(netdev, "Any DDP operation is allowed only on Phy0 NIC interface"); return -EINVAL;
}
/* If the user supplied "-" instead of file name rollback previously *storedprofile.
*/ if (strncmp(flash->data, "-", 2) != 0) { struct i40e_ddp_old_profile_list *list_entry; char profile_name[sizeof(I40E_DDP_PROFILE_PATH)
+ I40E_DDP_PROFILE_NAME_MAX];
status = i40e_ddp_load(netdev, ddp_config->data,
ddp_config->size, true);
if (!status) {
list_entry =
kzalloc(sizeof(struct i40e_ddp_old_profile_list) +
ddp_config->size, GFP_KERNEL); if (!list_entry) {
netdev_info(netdev, "Failed to allocate memory for previous DDP profile data.");
netdev_info(netdev, "New profile loaded but roll-back will be impossible.");
} else {
memcpy(list_entry->old_ddp_buf,
ddp_config->data, ddp_config->size);
list_entry->old_ddp_size = ddp_config->size;
list_add(&list_entry->list, &pf->ddp_old_prof);
}
}
release_firmware(ddp_config);
} else { if (!list_empty(&pf->ddp_old_prof)) {
status = i40e_ddp_restore(pf);
} else {
netdev_warn(netdev, "There is no DDP profile to restore.");
status = -ENOENT;
}
} return status;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet am 2026-10-04)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.