All of lore.kernel.org
 help / color / mirror / Atom feed
From: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: [PATCH for-next 3/4] IB/core: Support new type of join-state for multicast
Date: Tue, 19 Apr 2016 15:51:26 +0300	[thread overview]
Message-ID: <1461070287-13469-4-git-send-email-erezsh@mellanox.com> (raw)
In-Reply-To: <1461070287-13469-1-git-send-email-erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>


There are 4 types for MCG, FullMember, NonMember, SendOnlyNonMember,
and the new added type: SendOnlyFullMember.
Add support for the new SendOnlyFullMember join state.

The new type allows host to send join request as sendonly, it will cause the
group to be created but without getting packets from this multicast back to the
host.

Signed-off-by: Erez Shitrit <erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/core/multicast.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/core/multicast.c b/drivers/infiniband/core/multicast.c
index 250937c..31d9d41 100644
--- a/drivers/infiniband/core/multicast.c
+++ b/drivers/infiniband/core/multicast.c
@@ -93,6 +93,18 @@ enum {
 
 struct mcast_member;
 
+/*
+* There are 4 types of join states:
+* FullMember, NonMember, SendOnlyNonMember, SendOnlyFullMember.
+*/
+enum {
+	FULLMEMBER_JOIN,
+	NONMEMBER_JOIN,
+	SENDONLY_NONMEBER_JOIN,
+	SENDONLY_FULLMEMBER_JOIN,
+	NUM_JOIN_MEMBERSHIP_TYPES = 4
+};
+
 struct mcast_group {
 	struct ib_sa_mcmember_rec rec;
 	struct rb_node		node;
@@ -102,7 +114,7 @@ struct mcast_group {
 	struct list_head	pending_list;
 	struct list_head	active_list;
 	struct mcast_member	*last_join;
-	int			members[3];
+	int			members[NUM_JOIN_MEMBERSHIP_TYPES];
 	atomic_t		refcount;
 	enum mcast_group_state	state;
 	struct ib_sa_query	*query;
@@ -220,8 +232,9 @@ static void queue_join(struct mcast_member *member)
 }
 
 /*
- * A multicast group has three types of members: full member, non member, and
- * send only member.  We need to keep track of the number of members of each
+ * A multicast group has four types of members: full member, non member,
+ * sendonly non member and sendonly full member.
+ * We need to keep track of the number of members of each
  * type based on their join state.  Adjust the number of members the belong to
  * the specified join states.
  */
@@ -229,7 +242,7 @@ static void adjust_membership(struct mcast_group *group, u8 join_state, int inc)
 {
 	int i;
 
-	for (i = 0; i < 3; i++, join_state >>= 1)
+	for (i = 0; i < NUM_JOIN_MEMBERSHIP_TYPES; i++, join_state >>= 1)
 		if (join_state & 0x1)
 			group->members[i] += inc;
 }
@@ -245,7 +258,7 @@ static u8 get_leave_state(struct mcast_group *group)
 	u8 leave_state = 0;
 	int i;
 
-	for (i = 0; i < 3; i++)
+	for (i = 0; i < NUM_JOIN_MEMBERSHIP_TYPES; i++)
 		if (!group->members[i])
 			leave_state |= (0x1 << i);
 
-- 
1.7.11.3

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-04-19 12:51 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-19 12:51 [PATCH for-next 0/4] Support SendOnlyFullMember join Erez Shitrit
     [not found] ` <1461070287-13469-1-git-send-email-erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-04-19 12:51   ` [PATCH for-next 1/4] IB/core: Add support for get ClassPortInfo from the SA Erez Shitrit
     [not found]     ` <1461070287-13469-2-git-send-email-erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-05-12 23:17       ` Ira Weiny
2016-04-19 12:51   ` [PATCH for-next 2/4] IB/sa: Add support for sa get ClassPortInfo Erez Shitrit
     [not found]     ` <1461070287-13469-3-git-send-email-erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-04-20 12:09       ` Hal Rosenstock
     [not found]         ` <57177181.7090408-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-04-20 14:24           ` Erez Shitrit
2016-04-21 12:12           ` Erez Shitrit
2016-04-20 13:12       ` Or Gerlitz
     [not found]         ` <CAJ3xEMihe-54UExbp3ptqH5yqg7dc6a6tKcJw0gNytTECce5TQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-20 13:19           ` Erez Shitrit
2016-04-19 12:51   ` Erez Shitrit [this message]
     [not found]     ` <1461070287-13469-4-git-send-email-erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-04-26 20:16       ` [PATCH for-next 3/4] IB/core: Support new type of join-state for multicast Christoph Lameter
     [not found]         ` <alpine.DEB.2.20.1604261514590.2663-wcBtFHqTun5QOdAKl3ChDw@public.gmane.org>
2016-04-26 20:57           ` Hefty, Sean
     [not found]             ` <1828884A29C6694DAF28B7E6B8A82373AB045BD0-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2016-04-27  6:42               ` Leon Romanovsky
     [not found]                 ` <20160427064239.GO7974-2ukJVAZIZ/Y@public.gmane.org>
2016-04-29  2:34                   ` Doug Ledford
     [not found]                     ` <5722C839.2070704-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-04-29 15:50                       ` Hefty, Sean
     [not found]                         ` <1828884A29C6694DAF28B7E6B8A82373AB0475AC-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2016-04-29 16:10                           ` Doug Ledford
2016-04-29 16:27                       ` Hal Rosenstock
     [not found]                         ` <c99ef08a-77d8-1524-042a-0f269a52028d-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-04-29 17:12                           ` Jason Gunthorpe
     [not found]                             ` <20160429171246.GA4893-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-04-29 17:58                               ` Hal Rosenstock
     [not found]                                 ` <c1bc7c93-53c9-8b71-16eb-2bb92df93b76-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-04-30  1:37                                   ` Christoph Lameter
2016-05-02  7:26               ` Erez Shitrit
     [not found]                 ` <CAAk-MO8Zo2cHo8hiyYdbiSoRG2tgdxcSZPhCDWRUm6KrHCE8EQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-02 17:02                   ` Hefty, Sean
2016-04-19 12:51   ` [PATCH for-next 4/4] IB/ipoib: Support SendOnlyFullMember MCG for SendOnly join Erez Shitrit
     [not found]     ` <1461070287-13469-5-git-send-email-erezsh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-04-20 12:11       ` Hal Rosenstock
     [not found]         ` <571771FB.90908-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-04-20 13:12           ` Erez Shitrit
     [not found]             ` <CAAk-MO_24actZ4FJqOjk0ztR=Z6toSfB-xuyFKeUvtZ8h0Xv3A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-20 13:29               ` Hal Rosenstock
     [not found]                 ` <5717843B.7020501-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-04-21 12:52                   ` Erez Shitrit
     [not found]                     ` <CAAk-MO9sie_pFH7wSDhhuEd2uApnz5dMF6E9u6Vgkyimc+1xWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-21 13:24                       ` Hal Rosenstock
     [not found]                         ` <5718D497.70306-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-04-21 14:11                           ` Erez Shitrit
     [not found]                             ` <CAAk-MO9W-sdi4D+xT6C_TB7uWNMPV8++RRtyoLmJ23HFq11+iw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-21 17:32                               ` Jason Gunthorpe
     [not found]                                 ` <20160421173219.GA5814-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-05-02  8:00                                   ` Erez Shitrit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461070287-13469-4-git-send-email-erezsh@mellanox.com \
    --to=erezsh-vpraknaxozvwk0htik3j/w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.