Lines Matching refs:ch_sn2
1171 struct xpc_channel_sn2 *ch_sn2;
1243 ch_sn2 = &part->channels[ch_number].sn.sn2;
1245 ch_sn2->local_GP = &part_sn2->local_GPs[ch_number];
1246 ch_sn2->local_openclose_args =
1249 mutex_init(&ch_sn2->msg_to_pull_mutex);
1563 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2;
1571 ch_sn2->local_msgqueue =
1573 &ch_sn2->local_msgqueue_base);
1574 if (ch_sn2->local_msgqueue == NULL)
1578 ch_sn2->notify_queue = kzalloc(nbytes, GFP_KERNEL);
1579 if (ch_sn2->notify_queue == NULL) {
1580 kfree(ch_sn2->local_msgqueue_base);
1581 ch_sn2->local_msgqueue = NULL;
1608 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2;
1618 ch_sn2->remote_msgqueue =
1619 xpc_kzalloc_cacheline_aligned(nbytes, GFP_KERNEL, &ch_sn2->
1621 if (ch_sn2->remote_msgqueue == NULL)
1649 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2;
1659 kfree(ch_sn2->local_msgqueue_base);
1660 ch_sn2->local_msgqueue = NULL;
1661 kfree(ch_sn2->notify_queue);
1662 ch_sn2->notify_queue = NULL;
1675 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2;
1679 ch_sn2->remote_msgqueue_pa = 0;
1681 ch_sn2->local_GP->get = 0;
1682 ch_sn2->local_GP->put = 0;
1683 ch_sn2->remote_GP.get = 0;
1684 ch_sn2->remote_GP.put = 0;
1685 ch_sn2->w_local_GP.get = 0;
1686 ch_sn2->w_local_GP.put = 0;
1687 ch_sn2->w_remote_GP.get = 0;
1688 ch_sn2->w_remote_GP.put = 0;
1689 ch_sn2->next_msg_to_pull = 0;
1695 kfree(ch_sn2->local_msgqueue_base);
1696 ch_sn2->local_msgqueue = NULL;
1697 kfree(ch_sn2->remote_msgqueue_base);
1698 ch_sn2->remote_msgqueue = NULL;
1699 kfree(ch_sn2->notify_queue);
1700 ch_sn2->notify_queue = NULL;
1761 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2;
1765 get = ch_sn2->w_remote_GP.get;
1767 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->local_msgqueue +
1772 } while (++get < ch_sn2->remote_GP.get);
1781 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2;
1786 if (ch_sn2->remote_GP.put < remote_nentries)
1789 put = max(ch_sn2->w_remote_GP.put, remote_nentries);
1791 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->remote_msgqueue +
1798 } while (++put < ch_sn2->remote_GP.put);
1811 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2;
1814 ch_sn2->remote_GP = part->sn.sn2.remote_GPs[ch_number];
1820 if (ch_sn2->w_remote_GP.get == ch_sn2->remote_GP.get &&
1821 ch_sn2->w_remote_GP.put == ch_sn2->remote_GP.put) {
1838 if (ch_sn2->w_remote_GP.get != ch_sn2->remote_GP.get) {
1853 ch_sn2->remote_GP.get);
1862 ch_sn2->w_remote_GP.get = ch_sn2->remote_GP.get;
1865 "channel=%d\n", ch_sn2->w_remote_GP.get, ch->partid,
1881 if (ch_sn2->w_remote_GP.put != ch_sn2->remote_GP.put) {
1889 ch_sn2->w_remote_GP.put = ch_sn2->remote_GP.put;
1892 "channel=%d\n", ch_sn2->w_remote_GP.put, ch->partid,
1913 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2;
1921 if (mutex_lock_interruptible(&ch_sn2->msg_to_pull_mutex) != 0) {
1926 while (get >= ch_sn2->next_msg_to_pull) {
1930 msg_index = ch_sn2->next_msg_to_pull % ch->remote_nentries;
1932 DBUG_ON(ch_sn2->next_msg_to_pull >= ch_sn2->w_remote_GP.put);
1933 nmsgs = ch_sn2->w_remote_GP.put - ch_sn2->next_msg_to_pull;
1940 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->remote_msgqueue +
1942 remote_msg_pa = ch_sn2->remote_msgqueue_pa + msg_offset;
1950 "ret=%d\n", nmsgs, ch_sn2->next_msg_to_pull,
1955 mutex_unlock(&ch_sn2->msg_to_pull_mutex);
1959 ch_sn2->next_msg_to_pull += nmsgs;
1962 mutex_unlock(&ch_sn2->msg_to_pull_mutex);
1966 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->remote_msgqueue + msg_offset);
1977 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2;
1986 get = ch_sn2->w_local_GP.get;
1988 if (get == ch_sn2->w_remote_GP.put)
1998 if (cmpxchg(&ch_sn2->w_local_GP.get, get, get + 1) == get) {
2032 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2;
2040 if (put == ch_sn2->w_local_GP.put)
2043 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->
2059 if (cmpxchg_rel(&ch_sn2->local_GP->put, initial_put, put) !=
2062 DBUG_ON(ch_sn2->local_GP->put < initial_put);
2093 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2;
2107 put = ch_sn2->w_local_GP.put;
2109 if (put - ch_sn2->w_remote_GP.get < ch->local_nentries) {
2117 if (cmpxchg(&ch_sn2->w_local_GP.put, put, put + 1) ==
2146 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->local_msgqueue +
2172 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2;
2209 notify = &ch_sn2->notify_queue[msg_number % ch->local_nentries];
2245 put = ch_sn2->local_GP->put;
2265 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2;
2273 if (get == ch_sn2->w_local_GP.get)
2276 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->
2293 if (cmpxchg_rel(&ch_sn2->local_GP->get, initial_get, get) !=
2296 DBUG_ON(ch_sn2->local_GP->get <= initial_get);