]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NTB: Fix the default port and peer numbers for legacy drivers
authorLogan Gunthorpe <logang@deltatee.com>
Wed, 9 Jan 2019 19:22:28 +0000 (12:22 -0700)
committerJon Mason <jdmason@kudzu.us>
Sat, 6 Jun 2020 00:02:08 +0000 (20:02 -0400)
commitfc8b086d9dbd57458d136c4fa70ee26f832c3a2e
treece79d8cfcfaf08b8401672b7b3d7ac9ba76ceccb
parent40da7d9a93c8941737ef4a1208d32c13ce017fe1
NTB: Fix the default port and peer numbers for legacy drivers

When the commit adding ntb_default_port_number() and
ntb_default_peer_port_number()  entered the kernel there was no
users of it so it was impossible to tell what the API needed.

When a user finally landed a year later (ntb_pingpong) there were
more NTB topologies were created and no consideration was considered
to how other drivers had changed.

Now that there is a user it can be fixed to provide a sensible default
for the legacy drivers that do not implement ntb_{peer_}port_number().
Seeing ntb_pingpong doesn't check error codes returning EINVAL was also
not sensible.

Patches for ntb_pingpong and ntb_perf follow (which are broken
otherwise) to support hardware that doesn't have port numbers. This is
important not only to not break support with existing drivers but for
the cross link topology which, due to its perfect symmetry, cannot
assign unique port numbers to each side.

Fixes: 1e5301196a88 ("NTB: Add indexed ports NTB API")
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Allen Hubbe <allenbh@gmail.com>
Tested-by: Alexander Fomichev <fomichev.ru@gmail.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/core.c