You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2017/03/10 21:21:38 UTC
[2/3] qpid-dispatch git commit: WIP - private header changes
WIP - private header changes
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/73f5d91c
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/73f5d91c
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/73f5d91c
Branch: refs/heads/tross-dispatch-646
Commit: 73f5d91cf3b2ec430ead13cad3bd249d375baa8f
Parents: 5fce542
Author: Ted Ross <tr...@redhat.com>
Authored: Tue Mar 7 16:48:54 2017 -0500
Committer: Ted Ross <tr...@redhat.com>
Committed: Fri Mar 10 13:38:33 2017 -0500
----------------------------------------------------------------------
src/router_core/router_core_private.h | 161 +++++++++++++++++++----------
1 file changed, 106 insertions(+), 55 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/73f5d91c/src/router_core/router_core_private.h
----------------------------------------------------------------------
diff --git a/src/router_core/router_core_private.h b/src/router_core/router_core_private.h
index c657391..9c2d281 100644
--- a/src/router_core/router_core_private.h
+++ b/src/router_core/router_core_private.h
@@ -152,6 +152,104 @@ struct qdr_action_t {
ALLOC_DECLARE(qdr_action_t);
DEQ_DECLARE(qdr_action_t, qdr_action_list_t);
+//
+// General Work
+//
+// The following types are used to post work to the IO threads for
+// non-connection-specific action. These actions are serialized through
+// a zero-delay timer and are processed by one thread at a time. General
+// actions occur in-order and are not run concurrently.
+//
+typedef struct qdr_general_work_t qdr_general_work_t;
+typedef void (*qdr_general_work_handler_t) (qdr_core_t *core, qdr_general_work_t *work);
+
+struct qdr_general_work_t {
+ DEQ_LINKS(qdr_general_work_t);
+ qdr_general_work_handler_t handler;
+ qdr_field_t *field;
+ int maskbit;
+ int inter_router_cost;
+ qdr_receive_t on_message;
+ void *on_message_context;
+ qd_message_t *msg;
+};
+
+ALLOC_DECLARE(qdr_general_work_t);
+DEQ_DECLARE(qdr_general_work_t, qdr_general_work_list_t);
+
+qdr_general_work_t *qdr_general_work(qdr_general_work_handler_t handler);
+
+
+//
+// Connection Work
+//
+// The following types are used to post work to the IO threads for
+// connection-specific action. The actions for a particular connection
+// are run in-order and are not concurrent. Actions for different connections
+// will run concurrently.
+//
+typedef enum {
+ QDR_CONNECTION_WORK_FIRST_ATTACH,
+ QDR_CONNECTION_WORK_SECOND_ATTACH,
+ QDR_CONNECTION_WORK_FIRST_DETACH, // TODO - deprecate
+ QDR_CONNECTION_WORK_SECOND_DETACH // TODO - deprecate
+} qdr_connection_work_type_t;
+
+typedef struct qdr_connection_work_t {
+ DEQ_LINKS(struct qdr_connection_work_t);
+ qdr_connection_work_type_t work_type;
+ qdr_link_t *link;
+ qdr_terminus_t *source;
+ qdr_terminus_t *target;
+ qdr_error_t *error; // TODO - deprecate
+ bool close_link; // TODO - deprecate
+} qdr_connection_work_t;
+
+ALLOC_DECLARE(qdr_connection_work_t);
+DEQ_DECLARE(qdr_connection_work_t, qdr_connection_work_list_t);
+
+
+//
+// Link Work
+//
+// The following type is used to post link-specific work to the IO threads.
+// This ensures that work related to a particular link (deliveries, disposition
+// updates, flow updates, and detaches) are processed in-order.
+//
+// DELIVERY - Push up to _value_ deliveries from the undelivered list to the
+// link (outgoing links only). Don't push more than there is
+// available credit for. If the full number of deliveries (_value_)
+// cannot be pushed, don't consume this work item from the list.
+// This link will be blocked until further credit is received.
+// UPDATE - Push all of the disposition updates in the updated list.
+// FLOW - Push a flow update using _drain_mode_, _drain_mode_changed_, and
+// _value_ for the number of incremental credits.
+// FIRST_DETACH - Issue a first detach on this link, using _error_ if there is an
+// error condition.
+// SECOND_DETACH - Issue a second detach on this link.
+//
+typedef enum {
+ QDR_LINK_WORK_DELIVERY,
+ QDR_LINK_WORK_UPDATE,
+ QDR_LINK_WORK_FLOW,
+ QDR_LINK_WORK_FIRST_DETACH,
+ QDR_LINK_WORK_SECOND_DETACH
+} qdr_link_work_type_t;
+
+typedef struct qdr_link_work_t {
+ DEQ_LINKS(struct qdr_link_work_t);
+ qdr_link_work_type_t work_type;
+ qdr_error_t *error;
+ uint32_t value;
+ bool close_link;
+ bool drain_mode;
+ bool drain_mode_changed;
+} qdr_link_work_t;
+
+ALLOC_DECLARE(qdr_link_work_t);
+DEQ_DECLARE(qdr_link_work_t, qdr_link_work_list_t);
+
+
#define QDR_AGENT_MAX_COLUMNS 64
#define QDR_AGENT_COLUMN_NULL (QDR_AGENT_MAX_COLUMNS + 1)
@@ -262,6 +360,7 @@ struct qdr_link_t {
qdr_connection_t *conn; ///< [ref] Connection that owns this link
qd_link_type_t link_type;
qd_direction_t link_direction;
+ qdr_link_work_list_t work_list;
char *name;
int detach_count; ///< 0, 1, or 2 depending on the state of the lifecycle
qdr_address_t *owning_addr; ///< [ref] Address record that owns this link
@@ -276,11 +375,11 @@ struct qdr_link_t {
bool strip_annotations_in;
bool strip_annotations_out;
int capacity;
- int incremental_credit_CT;
- int incremental_credit;
+ int incremental_credit_CT; // TODO - deprecate
+ int incremental_credit; // TODO - deprecate
bool flow_started; ///< for incoming, true iff initial credit has been granted
- bool drain_mode;
- bool drain_mode_changed;
+ bool drain_mode; // TODO - deprecate
+ bool drain_mode_changed; // TODO - deprecate
int credit_to_core; ///< Number of the available credits incrementally given to the core
uint64_t total_deliveries;
@@ -389,59 +488,11 @@ void qdr_core_remove_address_config(qdr_core_t *core, qdr_address_config_t *addr
//
-// General Work
+// Connection Information
//
-// The following types are used to post work to the IO threads for
-// non-connection-specific action. These actions are serialized through
-// a zero-delay timer and are processed by one thread at a time. General
-// actions occur in-order and are not run concurrently.
+// This record is used to give the core thread access to the details
+// of a connection's configuration.
//
-typedef struct qdr_general_work_t qdr_general_work_t;
-typedef void (*qdr_general_work_handler_t) (qdr_core_t *core, qdr_general_work_t *work);
-
-struct qdr_general_work_t {
- DEQ_LINKS(qdr_general_work_t);
- qdr_general_work_handler_t handler;
- qdr_field_t *field;
- int maskbit;
- int inter_router_cost;
- qdr_receive_t on_message;
- void *on_message_context;
- qd_message_t *msg;
-};
-
-ALLOC_DECLARE(qdr_general_work_t);
-DEQ_DECLARE(qdr_general_work_t, qdr_general_work_list_t);
-
-qdr_general_work_t *qdr_general_work(qdr_general_work_handler_t handler);
-
-//
-// Connection Work
-//
-// The following types are used to post work to the IO threads for
-// connection-specific action. The actions for a particular connection
-// are run in-order and are not concurrent. Actions for different connections
-// will run concurrently.
-//
-typedef enum {
- QDR_CONNECTION_WORK_FIRST_ATTACH,
- QDR_CONNECTION_WORK_SECOND_ATTACH,
- QDR_CONNECTION_WORK_FIRST_DETACH,
- QDR_CONNECTION_WORK_SECOND_DETACH
-} qdr_connection_work_type_t;
-
-typedef struct qdr_connection_work_t {
- DEQ_LINKS(struct qdr_connection_work_t);
- qdr_connection_work_type_t work_type;
- qdr_link_t *link;
- qdr_terminus_t *source;
- qdr_terminus_t *target;
- qdr_error_t *error;
- bool close_link;
-} qdr_connection_work_t;
-
-ALLOC_DECLARE(qdr_connection_work_t);
-DEQ_DECLARE(qdr_connection_work_t, qdr_connection_work_list_t);
struct qdr_connection_info_t {
const char *container;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org