ib_verbs.h (181ae8844578d0a80f188c1d195fd6bb91bcec81) ib_verbs.h (72a7720fca37fec0daf295923f17ac5d88a613e1)
1/*
2 * Copyright (c) 2004 Mellanox Technologies Ltd. All rights reserved.
3 * Copyright (c) 2004 Infinicon Corporation. All rights reserved.
4 * Copyright (c) 2004 Intel Corporation. All rights reserved.
5 * Copyright (c) 2004 Topspin Corporation. All rights reserved.
6 * Copyright (c) 2004 Voltaire Corporation. All rights reserved.
7 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
8 * Copyright (c) 2005, 2006, 2007 Cisco Systems. All rights reserved.

--- 93 unchanged lines hidden (view full) ---

102#define ibdev_dbg(__dev, format, args...) \
103 ibdev_printk(KERN_DEBUG, __dev, format, ##args)
104#else
105__printf(2, 3) __cold
106static inline
107void ibdev_dbg(const struct ib_device *ibdev, const char *format, ...) {}
108#endif
109
1/*
2 * Copyright (c) 2004 Mellanox Technologies Ltd. All rights reserved.
3 * Copyright (c) 2004 Infinicon Corporation. All rights reserved.
4 * Copyright (c) 2004 Intel Corporation. All rights reserved.
5 * Copyright (c) 2004 Topspin Corporation. All rights reserved.
6 * Copyright (c) 2004 Voltaire Corporation. All rights reserved.
7 * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
8 * Copyright (c) 2005, 2006, 2007 Cisco Systems. All rights reserved.

--- 93 unchanged lines hidden (view full) ---

102#define ibdev_dbg(__dev, format, args...) \
103 ibdev_printk(KERN_DEBUG, __dev, format, ##args)
104#else
105__printf(2, 3) __cold
106static inline
107void ibdev_dbg(const struct ib_device *ibdev, const char *format, ...) {}
108#endif
109
110#define ibdev_level_ratelimited(ibdev_level, ibdev, fmt, ...) \
111do { \
112 static DEFINE_RATELIMIT_STATE(_rs, \
113 DEFAULT_RATELIMIT_INTERVAL, \
114 DEFAULT_RATELIMIT_BURST); \
115 if (__ratelimit(&_rs)) \
116 ibdev_level(ibdev, fmt, ##__VA_ARGS__); \
117} while (0)
118
119#define ibdev_emerg_ratelimited(ibdev, fmt, ...) \
120 ibdev_level_ratelimited(ibdev_emerg, ibdev, fmt, ##__VA_ARGS__)
121#define ibdev_alert_ratelimited(ibdev, fmt, ...) \
122 ibdev_level_ratelimited(ibdev_alert, ibdev, fmt, ##__VA_ARGS__)
123#define ibdev_crit_ratelimited(ibdev, fmt, ...) \
124 ibdev_level_ratelimited(ibdev_crit, ibdev, fmt, ##__VA_ARGS__)
125#define ibdev_err_ratelimited(ibdev, fmt, ...) \
126 ibdev_level_ratelimited(ibdev_err, ibdev, fmt, ##__VA_ARGS__)
127#define ibdev_warn_ratelimited(ibdev, fmt, ...) \
128 ibdev_level_ratelimited(ibdev_warn, ibdev, fmt, ##__VA_ARGS__)
129#define ibdev_notice_ratelimited(ibdev, fmt, ...) \
130 ibdev_level_ratelimited(ibdev_notice, ibdev, fmt, ##__VA_ARGS__)
131#define ibdev_info_ratelimited(ibdev, fmt, ...) \
132 ibdev_level_ratelimited(ibdev_info, ibdev, fmt, ##__VA_ARGS__)
133
134#if defined(CONFIG_DYNAMIC_DEBUG)
135/* descriptor check is first to prevent flooding with "callbacks suppressed" */
136#define ibdev_dbg_ratelimited(ibdev, fmt, ...) \
137do { \
138 static DEFINE_RATELIMIT_STATE(_rs, \
139 DEFAULT_RATELIMIT_INTERVAL, \
140 DEFAULT_RATELIMIT_BURST); \
141 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
142 if (DYNAMIC_DEBUG_BRANCH(descriptor) && __ratelimit(&_rs)) \
143 __dynamic_ibdev_dbg(&descriptor, ibdev, fmt, \
144 ##__VA_ARGS__); \
145} while (0)
146#else
147__printf(2, 3) __cold
148static inline
149void ibdev_dbg_ratelimited(const struct ib_device *ibdev, const char *format, ...) {}
150#endif
151
110union ib_gid {
111 u8 raw[16];
112 struct {
113 __be64 subnet_prefix;
114 __be64 interface_id;
115 } global;
116};
117

--- 328 unchanged lines hidden (view full) ---

446 IB_PORT_NOP = 0,
447 IB_PORT_DOWN = 1,
448 IB_PORT_INIT = 2,
449 IB_PORT_ARMED = 3,
450 IB_PORT_ACTIVE = 4,
451 IB_PORT_ACTIVE_DEFER = 5
452};
453
152union ib_gid {
153 u8 raw[16];
154 struct {
155 __be64 subnet_prefix;
156 __be64 interface_id;
157 } global;
158};
159

--- 328 unchanged lines hidden (view full) ---

488 IB_PORT_NOP = 0,
489 IB_PORT_DOWN = 1,
490 IB_PORT_INIT = 2,
491 IB_PORT_ARMED = 3,
492 IB_PORT_ACTIVE = 4,
493 IB_PORT_ACTIVE_DEFER = 5
494};
495
496enum ib_port_phys_state {
497 IB_PORT_PHYS_STATE_SLEEP = 1,
498 IB_PORT_PHYS_STATE_POLLING = 2,
499 IB_PORT_PHYS_STATE_DISABLED = 3,
500 IB_PORT_PHYS_STATE_PORT_CONFIGURATION_TRAINING = 4,
501 IB_PORT_PHYS_STATE_LINK_UP = 5,
502 IB_PORT_PHYS_STATE_LINK_ERROR_RECOVERY = 6,
503 IB_PORT_PHYS_STATE_PHY_TEST = 7,
504};
505
454enum ib_port_width {
455 IB_WIDTH_1X = 1,
456 IB_WIDTH_2X = 16,
457 IB_WIDTH_4X = 2,
458 IB_WIDTH_8X = 4,
459 IB_WIDTH_12X = 8
460};
461

--- 2180 unchanged lines hidden (view full) ---

2642 * netdev. */
2643 struct net_device *(*get_net_dev_by_params)(
2644 struct ib_device *dev,
2645 u8 port,
2646 u16 pkey,
2647 const union ib_gid *gid,
2648 const struct sockaddr *addr,
2649 void *client_data);
506enum ib_port_width {
507 IB_WIDTH_1X = 1,
508 IB_WIDTH_2X = 16,
509 IB_WIDTH_4X = 2,
510 IB_WIDTH_8X = 4,
511 IB_WIDTH_12X = 8
512};
513

--- 2180 unchanged lines hidden (view full) ---

2694 * netdev. */
2695 struct net_device *(*get_net_dev_by_params)(
2696 struct ib_device *dev,
2697 u8 port,
2698 u16 pkey,
2699 const union ib_gid *gid,
2700 const struct sockaddr *addr,
2701 void *client_data);
2650
2651 refcount_t uses;
2652 struct completion uses_zero;
2702 struct list_head list;
2653 u32 client_id;
2654
2655 /* kverbs are not required by the client */
2656 u8 no_kverbs_req:1;
2657};
2658
2659/*
2660 * IB block DMA iterator

--- 1047 unchanged lines hidden (view full) ---

3708static inline struct ib_cq *ib_alloc_cq(struct ib_device *dev, void *private,
3709 int nr_cqe, int comp_vector,
3710 enum ib_poll_context poll_ctx)
3711{
3712 return ib_alloc_cq_user(dev, private, nr_cqe, comp_vector, poll_ctx,
3713 NULL);
3714}
3715
2703 u32 client_id;
2704
2705 /* kverbs are not required by the client */
2706 u8 no_kverbs_req:1;
2707};
2708
2709/*
2710 * IB block DMA iterator

--- 1047 unchanged lines hidden (view full) ---

3758static inline struct ib_cq *ib_alloc_cq(struct ib_device *dev, void *private,
3759 int nr_cqe, int comp_vector,
3760 enum ib_poll_context poll_ctx)
3761{
3762 return ib_alloc_cq_user(dev, private, nr_cqe, comp_vector, poll_ctx,
3763 NULL);
3764}
3765
3766struct ib_cq *__ib_alloc_cq_any(struct ib_device *dev, void *private,
3767 int nr_cqe, enum ib_poll_context poll_ctx,
3768 const char *caller);
3769
3716/**
3770/**
3771 * ib_alloc_cq_any: Allocate kernel CQ
3772 * @dev: The IB device
3773 * @private: Private data attached to the CQE
3774 * @nr_cqe: Number of CQEs in the CQ
3775 * @poll_ctx: Context used for polling the CQ
3776 */
3777static inline struct ib_cq *ib_alloc_cq_any(struct ib_device *dev,
3778 void *private, int nr_cqe,
3779 enum ib_poll_context poll_ctx)
3780{
3781 return __ib_alloc_cq_any(dev, private, nr_cqe, poll_ctx,
3782 KBUILD_MODNAME);
3783}
3784
3785/**
3717 * ib_free_cq_user - Free kernel/user CQ
3718 * @cq: The CQ to free
3719 * @udata: Valid user data or NULL for kernel objects
3720 */
3721void ib_free_cq_user(struct ib_cq *cq, struct ib_udata *udata);
3722
3723/**
3724 * ib_free_cq - Free kernel CQ

--- 871 unchanged lines hidden ---
3786 * ib_free_cq_user - Free kernel/user CQ
3787 * @cq: The CQ to free
3788 * @udata: Valid user data or NULL for kernel objects
3789 */
3790void ib_free_cq_user(struct ib_cq *cq, struct ib_udata *udata);
3791
3792/**
3793 * ib_free_cq - Free kernel CQ

--- 871 unchanged lines hidden ---