From: Jason Gunthorpe <jgg@ziepe.ca>
To: Max Gurtovoy <maxg@mellanox.com>
Cc: linux-rdma@vger.kernel.org, dledford@redhat.com,
leonro@mellanox.com, sagi@grimberg.me
Subject: Re: [PATCH 1/1] IB/iser: remove redundant macro definitions
Date: Tue, 1 Oct 2019 11:30:23 -0300 [thread overview]
Message-ID: <20191001143023.GC11407@ziepe.ca> (raw)
In-Reply-To: <1569359148-12312-1-git-send-email-maxg@mellanox.com>
On Wed, Sep 25, 2019 at 12:05:48AM +0300, Max Gurtovoy wrote:
> Use the general linux definition for 4K and retrieve the rest from it.
>
> Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
> ---
> drivers/infiniband/ulp/iser/iscsi_iser.c | 2 +-
> drivers/infiniband/ulp/iser/iscsi_iser.h | 8 ++------
> drivers/infiniband/ulp/iser/iser_memory.c | 4 ++--
> drivers/infiniband/ulp/iser/iser_verbs.c | 4 ++--
> 4 files changed, 7 insertions(+), 11 deletions(-)
Applied to for-next, thanks
> --- a/drivers/infiniband/ulp/iser/iscsi_iser.h
> +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
> @@ -96,15 +96,11 @@
> #define iser_err(fmt, arg...) \
> pr_err(PFX "%s: " fmt, __func__ , ## arg)
>
> -#define SHIFT_4K 12
> -#define SIZE_4K (1ULL << SHIFT_4K)
> -#define MASK_4K (~(SIZE_4K-1))
> -
> /* Default support is 512KB I/O size */
> #define ISER_DEF_MAX_SECTORS 1024
> -#define ISCSI_ISER_DEF_SG_TABLESIZE ((ISER_DEF_MAX_SECTORS * 512) >> SHIFT_4K)
> +#define ISCSI_ISER_DEF_SG_TABLESIZE ((ISER_DEF_MAX_SECTORS * 512) >> ilog2(SZ_4K))
> /* Maximum support is 8MB I/O size */
> -#define ISCSI_ISER_MAX_SG_TABLESIZE ((16384 * 512) >> SHIFT_4K)
> +#define ISCSI_ISER_MAX_SG_TABLESIZE ((16384 * 512) >> ilog2(SZ_4K))
This had some conflicts and needed some fixing:
#define ISER_DEF_MAX_SECTORS 1024
#define ISCSI_ISER_DEF_SG_TABLESIZE \
- ((ISER_DEF_MAX_SECTORS * SECTOR_SIZE) >> SHIFT_4K)
+ ((ISER_DEF_MAX_SECTORS * SECTOR_SIZE) >> ilog2(SZ_4K))
/* Maximum support is 16MB I/O size */
-#define ISCSI_ISER_MAX_SG_TABLESIZE ((32768 * SECTOR_SIZE) >> SHIFT_4K)
+#define ISCSI_ISER_MAX_SG_TABLESIZE ((32768 * SECTOR_SIZE) >> ilog2(SZ_4K))
Jason
prev parent reply other threads:[~2019-10-01 14:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-24 21:05 [PATCH 1/1] IB/iser: remove redundant macro definitions Max Gurtovoy
2019-09-25 20:52 ` Sagi Grimberg
2019-10-01 14:30 ` Jason Gunthorpe [this message]
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=20191001143023.GC11407@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=dledford@redhat.com \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=maxg@mellanox.com \
--cc=sagi@grimberg.me \
/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.