Lines Matching full:entries

124  * index within the ksz9477 device's ACL table. It omits printing entries that
145 /* no need to print empty entries */ in ksz9477_dump_acl_index()
156 * ksz9477_dump_acl - Print ACL entries
171 dev_err(dev->dev, " Empty ACL entries were skipped\n"); in ksz9477_dump_acl()
206 * ksz9477_acl_get_cont_entr - Get count of contiguous ACL entries and validate
213 * in an ACL entry indicates which entries contain Matching rules linked to it.
222 * This function checks that, for complex rules, the entries containing the
224 * and returns the number of these contiguous entries.
229 * - The number of contiguous entries if it is the root entry of a complex
246 entry = &acles->entries[index].entry[0]; in ksz9477_acl_get_cont_entr()
283 /* loop over the contiguous entries and check for valid matching rules */ in ksz9477_acl_get_cont_entr()
285 u8 *current_entry = &acles->entries[i].entry[0]; in ksz9477_acl_get_cont_entr()
327 * Note: Fragmentation within a RuleSet is not supported. Hence, entries must
391 * @port: Port number on the KSZ device where the ACL entries reside.
393 * @dst_idx: Index of the destination where the source entries are intended to
396 * source entries if the validation passes.
398 * destination entries if the validation passes.
401 * provided for ACL entries. It checks if the indices are within the valid
402 * range, and if the source entries are contiguous. Additionally, the function
403 * ensures that there's adequate space at the destination for the source entries
406 * destination entries.
423 /* Validate if the source entries are contiguous */ in ksz9477_validate_and_get_src_count()
451 * ksz9477_move_entries_downwards - Move a range of ACL entries downwards in
454 * @acles: Pointer to the structure encapsulating all the ACL entries.
455 * @start_idx: Starting index of the entries to be relocated.
456 * @num_entries_to_move: Number of consecutive entries to be relocated.
460 * This function is responsible for rearranging a specific block of ACL entries
462 * destination indices. It ensures that the linkage between the ACL entries is
465 * Return: 0 on successful relocation of entries, otherwise returns a negative
478 e = &acles->entries[i]; in ksz9477_move_entries_downwards()
479 *e = acles->entries[i + num_entries_to_move]; in ksz9477_move_entries_downwards()
491 * ksz9477_move_entries_upwards - Move a range of ACL entries upwards in the
494 * @acles: Pointer to the structure holding all the ACL entries.
495 * @start_idx: The starting index of the entries to be moved.
496 * @num_entries_to_move: Number of contiguous entries to be moved.
500 * This function rearranges a chunk of ACL entries by moving them upwards
502 * process preserves the linkage between entries by updating it accordingly.
504 * Return: 0 if the entries were successfully moved, otherwise a negative error
518 e = &acles->entries[b]; in ksz9477_move_entries_upwards()
519 *e = acles->entries[i - 1]; in ksz9477_move_entries_upwards()
530 * ksz9477_acl_move_entries - Move a block of contiguous ACL entries from a
537 * This function aims to move a block of contiguous ACL entries from the source
542 * restore the ACL entries to their original state from the backup.
565 * destination index to account for the entries that will be moved in ksz9477_acl_move_entries()
573 buffer[i] = acles->entries[src_idx + i]; in ksz9477_acl_move_entries()
580 /* Adjust other entries and their linkage based on destination */ in ksz9477_acl_move_entries()
593 acles->entries[dst_idx + i] = buffer[i]; in ksz9477_acl_move_entries()
602 * @port: The port number on which the ACL entries are being checked.
607 * invalid or if it reaches the end of the ACL entries without finding another
608 * block, it returns the maximum ACL entries count.
677 * ksz9477_sort_acl_entr_no_back - Sort ACL entries for a given port based on
678 * priority without backing up entries.
680 * @port: The port number whose ACL entries need to be sorted.
682 * This function sorts ACL entries of the specified port using a variant of the
683 * bubble sort algorithm. It operates on blocks of ACL entries rather than
684 * individual entries. Each block's starting point is identified and then
689 * This is done in order to maintain an organized order of ACL entries based on
693 * - 0 on successful sorting of entries.
706 curr = &acles->entries[i]; in ksz9477_sort_acl_entr_no_back()
713 next = &acles->entries[j]; in ksz9477_sort_acl_entr_no_back()
735 * ksz9477_sort_acl_entries - Sort the ACL entries for a given port.
739 * This function sorts the Access Control List (ACL) entries for a specified
740 * port. Before sorting, a backup of the original entries is created. If the
742 * the original and attempted sorted entries, and then restore the original
743 * entries from the backup.
754 /* create a backup of the ACL entries, if something goes wrong in ksz9477_sort_acl_entries()
755 * we can restore the ACL entries. in ksz9477_sort_acl_entries()
757 memcpy(backup, acles->entries, sizeof(backup)); in ksz9477_sort_acl_entries()
761 dev_err(dev->dev, "ACL: failed to sort entries for port %d\n", in ksz9477_sort_acl_entries()
766 ksz9477_dump_acl(dev, acles->entries); in ksz9477_sort_acl_entries()
767 /* Restore the original entries */ in ksz9477_sort_acl_entries()
768 memcpy(acles->entries, backup, sizeof(backup)); in ksz9477_sort_acl_entries()
920 * ksz9477_acl_write_list - Write a list of ACL entries to a given port.
922 * @port: The port number on which to write ACL entries.
925 * of ACL entries to the port, and disables ACL functionality if there are no
926 * entries.
937 /* ACL should be enabled before writing entries */ in ksz9477_acl_write_list()
942 /* write all entries */ in ksz9477_acl_write_list()
943 for (i = 0; i < ARRAY_SIZE(acles->entries); i++) { in ksz9477_acl_write_list()
944 u8 *entry = acles->entries[i].entry; in ksz9477_acl_write_list()
978 * ksz9477_acl_remove_entries - Remove ACL entries with a given cookie from a
981 * @port: The port number on which to remove ACL entries.
985 * This function iterates through the entries array, removing any entries with
986 * a matching cookie value. The remaining entries are then shifted down to fill
1002 if (acles->entries[i].cookie == cookie) { in ksz9477_acl_remove_entries()
1008 /* No entries with the matching cookie found */ in ksz9477_acl_remove_entries()
1012 /* Get the size of the cookie entry. We may have complex entries. */ in ksz9477_acl_remove_entries()
1017 /* Move all entries down to overwrite removed entry with the cookie */ in ksz9477_acl_remove_entries()
1022 dev_err(dev->dev, "Failed to move ACL entries down\n"); in ksz9477_acl_remove_entries()
1031 struct ksz9477_acl_entry *entry = &acles->entries[i]; in ksz9477_acl_remove_entries()
1040 /* Adjust the total entries count */ in ksz9477_acl_remove_entries()
1051 * specified port, and initializes the ACL entries to a default state. The
1052 * entries are then written using the ksz9477_acl_write_list function, ensuring
1070 /* write all entries */ in ksz9477_port_acl_init()
1071 for (i = 0; i < ARRAY_SIZE(acles->entries); i++) { in ksz9477_port_acl_init()
1072 u8 *entry = acles->entries[i].entry; in ksz9477_port_acl_init()
1116 * @entry: An array containing the entries
1331 * entries. RuleSet has one bit for each of the 16 Matching rule entries.
1375 entry = &acles->entries[acles->entries_count]; in ksz9477_acl_get_init_entry()
1415 /* Add both match entries to first processing rule */ in ksz9477_acl_match_process_l2()