Re: [PATCH v2 10/15] NTB: ntb_test: Update ntb_tool DB tests

Logan Gunthorpe
2017-12-05T19:38:34Z

On 05/12/17 11:27 AM, Jon Mason wrote:
>> echo "Running db tests on: $(basename $LOC) / $(basename $REM)"
>>
>> - write_file "c $DB_BITMASK" "$REM/db"
>> + DB_VALID_MASK=$(read_file "$LOC/db_valid_mask")
>>
>> - for ((i=1; i <= 8; i++)); do
>> - let DB=$(read_file "$REM/db") || true
>> - if [[ "$DB" != "$EXP" ]]; then
>> + write_file "c $DB_VALID_MASK" "$REM/db"
>> +
>> + for ((i = 0; i < 64; i++)); do
>
> I'm guessing this should be a tunable variable, for those systems with
> a different number of doorbells.

That's actually the point of this patch. Serge is using db_valid_mask to
test all possible doorbells instead of just the first 8. 64 is just the
maximum number.

Looks like a nice improvement.

The only thing that's not clear to me is what this does:

> + write_file "c $DB_VALID_MASK" "$REM/db_mask"
> + write_file $DB_VALID_MASK "$REM/db_event"
> + write_file "s $DB_VALID_MASK" "$REM/db_mask"
> +
> + write_file "c $DB_VALID_MASK" "$REM/db"

It would be good to mention it in the commit message (then, as a rule of
thumb, commits that do "A" and "B" should actually be two commits).
Especially seeing db_event appears to be new and hasn't been discussed
in any commit message.

Logan