This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM4376: Linux/RT PRU/PRP driver issues

Part Number: AM4376

We faced few problems with PRP driver implementation on Linux. There's definetly problem with the node table in prueth_node_tbl.c. Sometimes the IND_BIN_NO(hash) in node_table_check_and_remove() becomes negative (that indicates corruption of structures as we can understand).

The network contains about 170 devices. Is there any possible side effect because of that taking into account that node table size is 128 elements?

  • Hello Alexander,

    What version of software are you using?

    Regards,

    Nick

  • We are using SDK 05.03.00.07 but as far as we can see there were no significant changes in prueth files.

    We made a couple of changes so far that we think should improve index handling, but we still face some performance degradation issues.

    Either way, can you please answer the main question:

    "The network contains about 170 devices. Is there any possible side effect because of that taking into account that node table size is 128 elements?"

  • I attached patch file that we made.

    In the move_up() function `start` points to the freed location, so indexes should be updated to the previous (not the next) location.

    In the node_table_insert_from_queue() function the check of `empty_slot` index in the for() cycle should be made before using it as index of BIN_NODEOFS() macro; and in case of look upwards the `index` (which points to some valid data) should be decremented first, otherwise data will get corrupted in the move_up() function.

    *** Z:/prueth_node_tbl.orig	Mon Oct 19 10:24:39 2020
    --- Z:/prueth_node_tbl.c	Mon Oct 19 10:34:19 2020
    ***************
    *** 244,250 ****
      	BIN_NODEOFS(start) = nt->nt_array_max_entries;
      
      	if (update)
    ! 		update_indexes(end, start + 1, nt);
      
      	pru_spin_unlock(nt);
      }
    --- 244,250 ----
      	BIN_NODEOFS(start) = nt->nt_array_max_entries;
      
      	if (update)
    ! 		update_indexes(end, start - 1, nt);
      
      	pru_spin_unlock(nt);
      }
    ***************
    *** 330,337 ****
      
      		/* look for an empty slot downwards */
      		for (empty_slot = index;
    ! 		     (BIN_NODEOFS(empty_slot) != nt->nt_array_max_entries) &&
    ! 		     (empty_slot < nt->nt_array_max_entries);
      		     empty_slot++)
      			;
      
    --- 330,337 ----
      
      		/* look for an empty slot downwards */
      		for (empty_slot = index;
    ! 		     (empty_slot < nt->nt_array_max_entries) &&
    ! 		     (BIN_NODEOFS(empty_slot) != nt->nt_array_max_entries);
      		     empty_slot++)
      			;
      
    ***************
    *** 341,347 ****
      		if (empty_slot != nt->nt_array_max_entries) {
      			move_down(index, empty_slot, nt, true);
      		} else {
    ! 			for (empty_slot = index - 1;
      			     (BIN_NODEOFS(empty_slot) !=
      			     nt->nt_array_max_entries) &&
      			     (empty_slot > 0);
    --- 341,348 ----
      		if (empty_slot != nt->nt_array_max_entries) {
      			move_down(index, empty_slot, nt, true);
      		} else {
    ! 			--index;
    ! 			for (empty_slot = index;
      			     (BIN_NODEOFS(empty_slot) !=
      			     nt->nt_array_max_entries) &&
      			     (empty_slot > 0);
    

  • Any idea? The question is very urgent for us.

  • Hello Alexander,

    I apologize for the delay. I am reassigning this to another engineer to take a look at.

    Regards,

    Nick

  • Still hope to get answer.