• Serge Semin's avatar
    NTB: Add indexed ports NTB API · 1e530119
    Serge Semin authored
    There is some NTB hardware, which can combine more than just two domains
    over NTB. For instance, some IDT PCIe-switches can have NTB-functions
    activated on more than two-ports. The different domains are distinguished
    by ports they are connected to. So the new port-related methods are added to
    the NTB API:
     ntb_port_number() - return local port
     ntb_peer_port_count() - return number of peers local port can connect to
     ntb_peer_port_number(pdix) - return port number by it index
     ntb_peer_port_idx(port) - return port index by it number
    
    Current test-drivers aren't changed much. They still support two-ports devices
    for the time being while multi-ports hardware drivers aren't added.
    
    By default port-related API is declared for two-ports hardware.
    So corresponding hardware drivers won't need to implement it.
    Signed-off-by: default avatarSerge Semin <fancer.lancer@gmail.com>
    Signed-off-by: default avatarJon Mason <jdmason@kudzu.us>
    1e530119
ntb.c 7.38 KB