mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Sreekanth Reddy <sreekanth.reddy@avagotech.com>
Cc: martin.petersen@oracle.com, jejb@kernel.org, hch@infradead.org,
	linux-scsi@vger.kernel.org, JBottomley@Parallels.com,
	Sathya.Prakash@avagotech.com,
	Nagalakshmi.Nandigama@avagotech.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 06/22] [SCSI] mpt2sas, mpt3sas: Removing uppper boundary restriction for the module parameter max_sgl_entries
Date: Wed, 10 Dec 2014 15:52:58 -0500	[thread overview]
Message-ID: <yq1wq5zcjmd.fsf@sermon.lab.mkp.net> (raw)
In-Reply-To: <1418131643-11568-1-git-send-email-Sreekanth.Reddy@avagotech.com> (Sreekanth Reddy's message of "Tue, 9 Dec 2014 18:57:23 +0530")

>>>>> "Sreekanth" == Sreekanth Reddy <sreekanth.reddy@avagotech.com> writes:

@@ -2486,9 +2486,13 @@ _base_allocate_memory_pools(struct MPT2SAS_ADAPTER *ioc,  int sleep_flag)
 
 	/* command line tunables  for max sgl entries */
 	if (max_sgl_entries != -1) {
-		ioc->shost->sg_tablesize = (max_sgl_entries <
-		    MPT2SAS_SG_DEPTH) ? max_sgl_entries :
-		    MPT2SAS_SG_DEPTH;
+		if (max_sgl_entries > MPT2SAS_SG_DEPTH)
+			printk(MPT2SAS_WARN_FMT
+			 "setting max_sgl_entries(%d), overriding kernel"
+			 " defined SCSI_MAX_SG_SEGMENTS(%d)\n", ioc->name,
+			  max_sgl_entries, MPT2SAS_SG_DEPTH);
+		ioc->shost->sg_tablesize =  min_t(unsigned short,
+			     max_sgl_entries, SCSI_MAX_SG_CHAIN_SEGMENTS);
 	} else {
 		ioc->shost->sg_tablesize = MPT2SAS_SG_DEPTH;
 	}

Wouldn't it be better to print the new scatterlist limit after it has
been clamped to reflect what it's actually being set to?

-- 
Martin K. Petersen	Oracle Linux Engineering

  reply	other threads:[~2014-12-10 20:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-09 13:27 Sreekanth Reddy
2014-12-10 20:52 ` Martin K. Petersen [this message]
2014-12-11 12:14   ` Sreekanth Reddy
2015-01-07  0:17     ` Martin K. Petersen
  -- strict thread matches above, loose matches on Subject: below --
2015-01-07 12:53 Sreekanth Reddy
2015-01-09 20:55 ` Martin K. Petersen
2014-11-20  7:05 [PATCH 00/22] mpt2sas, mpt3sas: SAS2 Phase 19,20 and SAS3 Phase 4,5 patches Sreekanth Reddy
2014-11-20  7:05 ` [PATCH 06/22] [SCSI] mpt2sas, mpt3sas: Removing uppper boundary restriction for the module parameter max_sgl_entries Sreekanth Reddy
2014-12-04  3:05   ` Martin K. Petersen

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=yq1wq5zcjmd.fsf@sermon.lab.mkp.net \
    --to=martin.petersen@oracle.com \
    --cc=JBottomley@Parallels.com \
    --cc=Nagalakshmi.Nandigama@avagotech.com \
    --cc=Sathya.Prakash@avagotech.com \
    --cc=hch@infradead.org \
    --cc=jejb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sreekanth.reddy@avagotech.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®