Microsemi / switchtec-kernel

A kernel module for the Microsemi PCIe switch
GNU General Public License v2.0
45 stars 31 forks source link

Enhance force down link feature. #37

Closed ghost closed 5 years ago

ghost commented 6 years ago

When a host is not a surviving host, but it receives the link force down massage, it should skip the link force down massage. To reinitialize the shared memory window, the driver just need to reinitialize the reserved LUT window.

ghost commented 6 years ago

To use the force down link feature, we should add following patch on ntb_transport.c .

diff --git a/ntb_transport.c b/ntb_transport.c index 9878c48..8a8638d 100644 --- a/ntb_transport.c +++ b/ntb_transport.c @@ -700,10 +700,6 @@ static int ntb_set_mw(struct ntb_transport_ctx *nt, int num_mw, xlat_size = round_up(size, xlat_align_size); buff_size = round_up(size, xlat_align); ` - / No need to re-setup / - if (mw->xlat_size == xlat_size) - return 0; - if (mw->buff_size) ntb_free_mw(nt, num_mw);`

Thanks Joey

wesleywesley commented 6 years ago

it is better to rework the commit message https://www.kernel.org/doc/html/v4.16/process/submitting-patches.html#describe-your-changes a good commit message not only make people easily understood the patch, but also smoothing the process of upstream.

ghost commented 6 years ago

@wesleywesley I have updated the commit message. Please help to review it.

wesleywesley commented 6 years ago

@JoeyZhang-Microsemi

  1. reconfigring --> reconfiguring

  2. change to microchip account

  3. . pls run checkpatch.pl for this patch and fix the error and warnings if any, before pull request for others review

test@server1:~/switchtec-kernel$ ~/kernel/linux-4.17.6/scripts/checkpatch.pl 0001-ntb_hw_switchtec-Optimize-function-switchtec_ntb_rei.patch WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)

7:

Function switchtec_ntb_reinit_peer() is used to reinitialize the shared NTB memory window.

WARNING: Missing a blank line after declarations

44: FILE: ntb_hw_switchtec.c:1481:

ERROR: Missing Signed-off-by: line(s)

total: 1 errors, 2 warnings, 32 lines checked

NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace.

0001-ntb_hw_switchtec-Optimize-function-switchtec_ntb_rei.patch has style problems, please review.

NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.

ghost commented 6 years ago

@wesleywesley Thanks for the review. I have fixed issues.