From owner-freebsd-scsi@FreeBSD.ORG Thu Jan 29 18:56:44 2015 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F194A336 for ; Thu, 29 Jan 2015 18:56:43 +0000 (UTC) Received: from mail-wi0-f170.google.com (exprod7og120.obsmtp.com [64.18.2.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24EF47C9 for ; Thu, 29 Jan 2015 18:56:42 +0000 (UTC) Received: from mail-wi0-f170.google.com ([209.85.212.170]) (using TLSv1) by exprod7ob120.postini.com ([64.18.6.12]) with SMTP ID DSNKVMqCY1801xSI/hEjSj5mCcP7dGHqSqEM@postini.com; Thu, 29 Jan 2015 10:56:43 PST Received: by mail-wi0-f170.google.com with SMTP id bs8so13989814wib.1 for ; Thu, 29 Jan 2015 10:56:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:thread-index:date:message-id :subject:to:content-type; bh=4hZiQziQI1ABO59Noq2XGrtNhEpU/BSC9pL7SxSyMwk=; b=ERbcsyBo1V0cU1VA5kJFf9fjvoImXGZ+kITFjFYIRuidToCkDSG2biXeBr1sbwjUbN 4jkPiyO2nvi6DihCw/gltMc9kq4DjnMK/Bx9Majqd52gTcmduD0wJx7RDX34/oGvpgMn M+T6AbweUE+KvsqAiMRJbum8mD/F4+4dBpnU2hbMZ1DPHEriSXOkT/ISUqgZdk6HV1C+ sOfZDXzRlz7Fp/E0exC/4eqya1uwCAdmWUvE1JlgZEjgV5a31UhG+AkCDh6WVOfkbfn5 PLyciq8oRFfqqx2URs3/WZjxJ3A2EpH3Msey3CJnG085SPmTR7lwsTR6sV+zk10eWHbI 4E3A== X-Gm-Message-State: ALoCoQmOLVxWRSATJ3ii7adzPjEBwnSAuJtUp070uzS7wkCcHaGxCin/ABFcUWt2t1WH+8vljW3I0jAlz1b6lKyTFLSdshYjt877UGQjFk0xcw9qea7k0yWU9srTttDi5g7JQgV7dEPStF3rNzA83b3R4RALBk6uUg== X-Received: by 10.180.98.3 with SMTP id ee3mr4183287wib.12.1422557795371; Thu, 29 Jan 2015 10:56:35 -0800 (PST) X-Received: by 10.180.98.3 with SMTP id ee3mr4183262wib.12.1422557795153; Thu, 29 Jan 2015 10:56:35 -0800 (PST) From: Sibananda Sahu MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdA79UEB0PauHoWcTx2d/YXUH38PpQ== Date: Fri, 30 Jan 2015 00:26:33 +0530 Message-ID: Subject: How to send 1MB I/O size in a single I/O request without split To: freebsd-scsi@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2015 18:56:44 -0000 Hi All, Recently we have added large I/O size of 1MB in our LSI controller and for that we have implemented the same in driver. But I have observed that the large I/O that an application is able to send is 128KB in one I/O request. I used the following command to send 1MB I/O: # ddpt if=/dev/da0 of=/dev/zero count=1 bs=1M But I have observed that the number of scatter gather elements per I/O request always comes 1 and the I/O length comes as 128KB(max). How can I get an I/O request from an application that will send 256 scatter gather elements of size 4K each(which makes a single 1MB I/O request). I have seen this kind of request in LINUX, but in FreeBSD I have received only 1 sge count and 128KB max I/O length. mrsas(4) driver reports to CAM layer that it supports 1MB I/O size. ccb->cpi.maxio = sc->max_num_sge * MRSAS_PAGE_SIZE; [Final value that is reported is (256 * 4096)] After a little investigation I found the following in sys/cam/scsi/scsi_da.c if (cpi.maxio == 0) softc->disk->d_maxsize = DFLTPHYS; /* traditional default */ else if (cpi.maxio > MAXPHYS) softc->disk->d_maxsize = MAXPHYS; /* for safety */ else softc->disk->d_maxsize = cpi.maxio; So even if the controller supports max I/O size greater than 128KB, it is restricted to 128KB only. I have changed the value of MAXPHYS from (128 * 1024) to (1024 * 1024) just to see if I can get 1MB I/O request to driver and simultaneously whether the driver can process 1M I/O size or not. I observed that after this modification I am able to get 1MB I/O request from the application. Number of sge is still 1 but the I/O length is now 1MB. Further information: Mrsas(4) driver supports UNMAPPED I/O. I have exercised the same thing with UNMAPPED I/O disabled but the result was same. So my primary questions are: - How can I send a large I/O size of 1MB in a single I/O request without any split? - Why I am getting always 1 scatter gather element? - How can I get more sge count in an I/O request? Thanks, Sibananda Sahu Device driver developer @ AVAGO Technologies.