Page MenuHomeFreeBSD

mpi3mr: poll reply queue and add MPI3MR_DEV_REMOVE_HS_COMPLETED flag
AcceptedPublic

Authored by chandrakanth.patil_broadcom.com on Mar 19 2024, 11:31 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 12:47 PM
Unknown Object (File)
Fri, Apr 26, 8:27 AM
Unknown Object (File)
Mon, Apr 22, 5:50 PM
Unknown Object (File)
Apr 19 2024, 6:42 PM
Unknown Object (File)
Apr 5 2024, 4:29 PM
Unknown Object (File)
Mar 31 2024, 5:52 AM
Unknown Object (File)
Mar 28 2024, 2:06 AM
Unknown Object (File)
Mar 22 2024, 5:56 PM
Subscribers
None

Details

Summary

An outstanding IO counter per target check has been added before deleting
the target from the OS which will poll the reply queue if there are any
outstanding IOs are found.

A new flag, named "MPI3MR_DEV_REMOVE_HS_COMPLETED," is added. If a remove event
for a target occurs and before the deletion of the target resource if the add event
for another target arrives reusing the same target ID then this flag will prevent
the removal of the target reference. This flag ensures synchronization between the interrupt
top and bottom half during target removal and addition events.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Need to adjust patch description a bit to keep code changes and description better aligned.

Fine as it is if the same sort of redundancy is done elsewhere

sys/dev/mpi3mr/mpi3mr_cam.c
1871

This assignment is redundant for a local variable exiting scope.

This revision is now accepted and ready to land.Mar 21 2024, 8:44 AM

Need to adjust patch description a bit to keep code changes and description better aligned.

Agreed. Will update the patch description.

In D44423#1013705, @imp wrote:

Fine as it is if the same sort of redundancy is done elsewhere

Ok. We will keep this now. however, we are going to submit a separate cleanup patch where we are going to address this and other similar issues.

sys/dev/mpi3mr/mpi3mr.c
3615

This looks like an extra tab. Not neat. I saw the same extra tabs in other places too.

sys/dev/mpi3mr/mpi3mr_cam.c
1826–1832

Are the spaces missing here between %d and the strings continuations next line?

Another cosmetic issue is that you are reading the counter separately for condition and printing. I suppose it may report 0

1844

Do we really need to wait for outstanding commands with 1 second granularity, while burning CPU time in a tight loop? Could we sleep in this context and/or do it in smaller increments to not wait longer than necessary?

sys/dev/mpi3mr/mpi3mr_cam.c
1844

Ah, I see you are removing it in next commit.

sys/dev/mpi3mr/mpi3mr.c
3615

It will be taken care of in the debug/cleanup patch.

sys/dev/mpi3mr/mpi3mr_cam.c
1826–1832

Agreed. The space is missing and the outstanding counter could be zero by the time it gets printed. I will re-submit the patch correcting it.

sys/dev/mpi3mr/mpi3mr_cam.c
1826–1832

Hi Mavi,

Thanks for the feedback. I have uploaded the new patch: https://reviews.freebsd.org/D44494 addressing this issue.