[PATCH v5 03/10] NTB: Introduce helper functions to calculate logical port number