From patchwork Sun Jul 3 21:46:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Or Gerlitz X-Patchwork-Id: 9211457 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 78B6C60571 for ; Sun, 3 Jul 2016 21:46:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69FF028608 for ; Sun, 3 Jul 2016 21:46:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D535286DE; Sun, 3 Jul 2016 21:46:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B84E28608 for ; Sun, 3 Jul 2016 21:46:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932212AbcGCVqd (ORCPT ); Sun, 3 Jul 2016 17:46:33 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:34850 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932198AbcGCVqd (ORCPT ); Sun, 3 Jul 2016 17:46:33 -0400 Received: by mail-oi0-f65.google.com with SMTP id d132so20672574oig.2 for ; Sun, 03 Jul 2016 14:46:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=5DmWyAvdFBnm+x2vWW0UUmjwXENZMdYG42hT6tdQ3Ac=; b=wWOxLDNByAbfKkRzTVK+E+x+d4MSCqWm+0TZ5Py2xZvBORYJDif2XrQ5tKpXjI3N0x UZA5OLtr0LIivbqy/0PpSwxfYZWJCM7NKqC+deNAlPlEgqtYGUe5KdYRryqPyxcKd9Q3 +EKefv18qNXsEpSAmsjKz/ky/O2nHaFKR1imIn35e9mwM4nYED7LzG6L9UmQia8xLy07 xYFrKjcaoX6tR6MtPcVmptXtqq0Dl0DT5sgARZ249gyjl691+nLzuk9oE+E0MM6Qt5+r ZT/jbm2ChV4Wn3Of5mCx9FshdxiU3MbFwBp0L8bUv9aioe/dEy36ylMTqGZYjgOtf2Ia 9k5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=5DmWyAvdFBnm+x2vWW0UUmjwXENZMdYG42hT6tdQ3Ac=; b=ihHbkfQccQr9pVVpktgVarW6oeIzRx10mkTNXrrkZeGw0W1MzwnSTuEIO8bYCeRkCv mxSRoz2+V9ymjij5MXim0B9quQ/4I+nvJKI3kEalnDzDVHywS4FgVq99b+QgnXR4WAqK mbrgvchpCVoTsdI8tdZ6ODi6/FfI4XZMbSNnfHgluFRe4XRIsRiydtEq6p+A5Yen5upE F1Mj194IGE0xKNIBLRGbZ7qt6o3fQ3Mg4ZgkdV2rShP70AbU6m0vcvv425f6IxOr74EM cS9f8F9FfKwJRzm31ntIFVciPbjseYeHu0gvAYUYNXAUIu8fsz7ECDxGxzaW0qcqeAA0 +QPA== X-Gm-Message-State: ALyK8tJlspmdEW92Xfh/+vMFIZX9eoz6rTzrqMV9uBeYRMY3jky/dz+zmH3XNcSNgupCAZiMASAU0UmHiz/r8g== X-Received: by 10.157.29.161 with SMTP id y30mr5610275otd.148.1467582392313; Sun, 03 Jul 2016 14:46:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.86.97 with HTTP; Sun, 3 Jul 2016 14:46:31 -0700 (PDT) In-Reply-To: <1467550074-24061-3-git-send-email-leon@kernel.org> References: <1467550074-24061-1-git-send-email-leon@kernel.org> <1467550074-24061-3-git-send-email-leon@kernel.org> From: Or Gerlitz Date: Mon, 4 Jul 2016 00:46:31 +0300 Message-ID: Subject: Re: [PATCH for-next 2/2] IB/core: Support for CMA multicast join flags To: Alex Vesker , Erez Shitrit Cc: Doug Ledford , Leon Romanovsky , "linux-rdma@vger.kernel.org" Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sun, Jul 3, 2016 at 3:47 PM, Leon Romanovsky wrote: > From: Alex Vesker > Added UCMA and CMA support for multicast join flags. Flags are > passed using UCMA CM join command previously reserved fields. > Currently supporting two join flags indicating two different > multicast JoinStates: [...] > --- a/include/rdma/ib_sa.h > +++ b/include/rdma/ib_sa.h > +#define IB_SA_MCMEMBER_REC_JOIN_STATE_FULL_MEMBER BIT(0) > +#define IB_SA_MCMEMBER_REC_JOIN_STATE_NON_MEMBER BIT(1) > +#define IB_SA_MCMEMBER_REC_JOIN_STATE_SO_NON_MEMBER BIT(2) > +#define IB_SA_MCMEMBER_REC_JOIN_STATE_SO_FULL_MEMBER BIT(3) > + can we somehow avoid repeating defining these join states in 2-3 places and either make the code introduced in commit cd6e9b7ef "IB/core: Support new type of join-state for multicast" Or. --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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, +}; to use the above defines, or the code added by this patch to use the enum Erez added, or both code pieces to be re-written and use some shared enum/define?