[openib-general] AT interface

Sean Hefty sean.hefty at intel.com
Tue Aug 16 18:14:02 PDT 2005


Sorry if I'm repeating some old AT discussions, but I'm trying to decipher the
AT API.  As an example, I call:

int ib_at_route_by_ip(uint32_t dst_ip, uint32_t src_ip, int tos,
			uint16_t flags,
			struct ib_at_ib_route *ib_route,
			struct ib_at_completion *async_comp,
			uint64_t *req_id);

struct ib_at_completion contains a pointer to a callback function, as show:

struct ib_at_completion {
	void (*fn)(uint64_t req_id, void *context, int rec_num);
	void *context;
	uint64_t req_id;
};

I then call:

int ib_at_callback_get(void);

Does this result in the callback function specified by the ib_at_completion
structure being invoked with any returned routes copied to the ib_route
parameter that was passed into ib_at_route_by_ip?  Is there always only one
route?  Will AT invoke the user's callback automatically, or only as a result of
calling get (and done in the user's thread)?

Assuming that my understanding is correct, can we eliminate the callback and
change the API to something that's easier to use and understand?  It's a chore
just trying to decipher the struct ib_at_completion comments.  I'm thinking of
something more like this:

int ib_at_route_by_ip(uint32_t dst_ip, uint32_t src_ip, int tos,
			uint16_t flags, uint64_t *req_id);

int ib_at_response_get(struct ib_at_response *);

int ib_at_response_put(struct ib_at_response *);

(Or even replacing uint32_t IP addresses with struct addrinfo or struct
sockaddr, but that's a separate issue.)  Would you accept such changes?

- Sean




More information about the general mailing list