smc_pnet.h 935 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Shared Memory Communications over RDMA (SMC-R) and RoCE
  4. *
  5. * PNET table queries
  6. *
  7. * Copyright IBM Corp. 2016
  8. *
  9. * Author(s): Thomas Richter <tmricht@linux.vnet.ibm.com>
  10. */
  11. #ifndef _SMC_PNET_H
  12. #define _SMC_PNET_H
  13. #if IS_ENABLED(CONFIG_HAVE_PNETID)
  14. #include <asm/pnet.h>
  15. #endif
  16. struct smc_ib_device;
  17. struct smcd_dev;
  18. static inline int smc_pnetid_by_dev_port(struct device *dev,
  19. unsigned short port, u8 *pnetid)
  20. {
  21. #if IS_ENABLED(CONFIG_HAVE_PNETID)
  22. return pnet_id_by_dev_port(dev, port, pnetid);
  23. #else
  24. return -ENOENT;
  25. #endif
  26. }
  27. int smc_pnet_init(void) __init;
  28. void smc_pnet_exit(void);
  29. int smc_pnet_remove_by_ibdev(struct smc_ib_device *ibdev);
  30. void smc_pnet_find_roce_resource(struct sock *sk,
  31. struct smc_ib_device **smcibdev, u8 *ibport,
  32. unsigned short vlan_id, u8 gid[]);
  33. void smc_pnet_find_ism_resource(struct sock *sk, struct smcd_dev **smcismdev);
  34. #endif