All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Loding rules
From: Roberto Nibali @ 2002-12-16 10:47 UTC (permalink / raw)
  To: nedco; +Cc: netfilter
In-Reply-To: <3df77ff9.7a14.0@unacs.bg>

> Hi,
>  How to load fast about 20000 rules in iptables.
>  If some document will be help , please let me know  :)

Netfilter is not designed for that. Please use the nf-hipac[1] drop-in 
replacement. NF-hipac will do the filtering and rule organisation for you and 
for the rest (NAT, mangle) you can still use netfilter. Also you should check if 
you can't logically draw a binary tree with your rules which would then result 
in faster matching lookup (at least with netfilter).

And no: iptables-save/restore is _not_ an option for dynamically changing rules!

If you have that many rules you certainly have a logic or kind of a matrix 
behind that. Try to use some algebraic transformations (linear translation, 
Laplace (define network flows), Gauss, TSP, ...) to optimize the ruleset. I have 
done this and successfully reduced the number of rules.

[1] http://www.hipac.org

Regards,
Roberto Nibali, ratz
-- 
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc



^ permalink raw reply

* Re: Intel sez: Synchronous Flash and XIP is the future -- thoughts?
From: Wolfgang Denk @ 2002-12-16 11:16 UTC (permalink / raw)
  To: Michal Schulz; +Cc: David Woodhouse, Paul Nash, Linux-MTD (E-mail)
In-Reply-To: <Pine.GSO.4.44.0212161155540.15280-100000@rose.man.poznan.pl>

In message <Pine.GSO.4.44.0212161155540.15280-100000@rose.man.poznan.pl> you wrote:
>
> With the XIP in kernel it is relatively simple with 2.2.x serie of
> kernels. I have managed to put most of 2.2.18 kernel onto flash, where it

We also tested this with 2.4.4 on PowerPC.

> was executing from. The most problems are with .rodata section, which is
> not read-only for kernel. It is so because some structures (one passed to

With recent kernels, at least on PPC, there are also places where the
.text  segment  is  written  into.  Some  people  even  find  "binary
patching" a cool idea.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
FORTRAN? The syntactically incorrect statement "DO 10 I = 1.10"  will
parse  and  generate  code  creating  a  variable, DO10I, as follows:
"DO10I = 1.10" If that doesn't terrify you, it should.

^ permalink raw reply

* [BUG] module-init-tools 0.9.3, rmmod modules with '-'
From: Vamsi Krishna S . @ 2002-12-16 11:06 UTC (permalink / raw)
  To: rusty; +Cc: lkml

Hi Rusty,

It seems we cannot unload modules if they have a '-' in their name. 
filename2modname() in rmmod.c converts a '-' in the filename
to '_'. Why? Are dashes not allowed as part of module names?

For eg: (kernel 2.5.52/module-init-tools 0.9.3)

[root@llm10 test-modules]# ./insmod probe-test.o
[root@llm10 test-modules]# ./lsmod
Module                  Size  Used by
probe-test               943  0
[root@llm10 test-modules]# cat /proc/modules
probe-test 943 0
[root@llm10 test-modules]# ./rmmod -V
module-init-tools version 0.9.3
[root@llm10 test-modules]# ./rmmod probe-test
ERROR: Module probe_test does not exist in /proc/modules
                   ^note this

Editing filename2modname() to remove this special test for
'-' seems to fix it. But, this is done explicitly, so
I wonder if there is a deeper meaning to this. Can you
please take a look and explain?

Thanks,
Vamsi.
-- 
Vamsi Krishna S.
Linux Technology Center,
IBM Software Lab, Bangalore.
Ph: +91 80 5044959
Internet: vamsi@in.ibm.com
--
--- rmmod-old.c	2002-12-13 21:11:57.000000000 +0530
+++ rmmod.c	2002-12-13 21:10:44.000000000 +0530
@@ -157,9 +157,12 @@
 	else
 		afterslash++;
 
-	/* stop at first . */
+	/* Convert to underscores, stop at first . */
 	for (i = 0; afterslash[i] && afterslash[i] != '.'; i++) {
-		modname[i] = afterslash[i];
+		if (afterslash[i] == '-')
+			modname[i] = '_';
+		else
+			modname[i] = afterslash[i];
 	}
 	modname[i] = '\0';
 }

^ permalink raw reply

* Re: [LARTC] total bandwidth ocupied
From: Stef Coene @ 2002-12-16 10:41 UTC (permalink / raw)
  To: lartc
In-Reply-To: <marc-lartc-104000531807331@msgid-missing>

On Monday 16 December 2002 03:25, Adi Nugroho wrote:
> Dear sir/madam,
>
> I discover that bandwidth usage which is limited using htb is about 5 to
> 10% higher than the rate/ceil we set, if we monitor it using iptraf.
>
> I become more confused since I saw, the grafic in HTB homepage are also
> show more bandwidth than the setting.
>
> My question is:
> * what is the exac value of this over bandwidth?
> * how to make the bandwidth are limited exacly at "x" kbps?
I did some "stream" tests with htb.  I generated a lot of tcp traffic with tcp 
and recorded the shaped bandwidth.  The result is allmost perfect. (results 
can be found on www.docum.org on the test pages).

But in a real world scenario, you also have bursts in the traffic.  Maybe you 
allow bursts (you always have some minimal bursts) so the average bandwidth 
may be higher then the configured bandwith.  

Stef


-- 

stef.coene@docum.org
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply

* [TRIVIAL] [Trivial Patch] scsi_register-008
From: Rusty Trivial Russell @ 2002-12-16 10:39 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Achim Leubner, linux-scsi

(Included in 2.5)
From:  Michael Still <mikal@stillhq.com>

  
  This patch has been generated as part of my scsi_register audit of the 2.5.45 kernel tree. scsi_register() can fail, returning a NULL pointer, and the failure case was not being handled here...
  
  
  
  

--- trivial-2.4.21-pre1/drivers/scsi/gdth.c.orig	2002-12-16 17:22:29.000000000 +1100
+++ trivial-2.4.21-pre1/drivers/scsi/gdth.c	2002-12-16 17:22:29.000000000 +1100
@@ -4253,6 +4253,9 @@
             if (gdth_ctr_count >= MAXHA)
                 break;
             shp = scsi_register(shtp,sizeof(gdth_ext_str));
+	    if(shp == NULL)
+		    continue;
+
             ha = HADATA(shp);
             if (!gdth_init_pci(&pcistr[ctr],ha)) {
                 scsi_unregister(shp);
-- 
  Don't blame me: the Monkey is driving
  File: Michael Still <mikal@stillhq.com>: [Trivial Patch] scsi_register-008

^ permalink raw reply

* [TRIVIAL] [Trivial Patch] scsi_register-006
From: Rusty Trivial Russell @ 2002-12-16 10:39 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Achim Leubner, linux-scsi

(Included in 2.5)
From:  Michael Still <mikal@stillhq.com>

  
  This patch has been generated as part of my scsi_register audit of the 2.5.45 kernel tree. scsi_register() can fail, returning a NULL pointer, and the failure case was not being handled here...
  
  
  
  

--- trivial-2.4.21-pre1/drivers/scsi/gdth.c.orig	2002-12-16 17:22:29.000000000 +1100
+++ trivial-2.4.21-pre1/drivers/scsi/gdth.c	2002-12-16 17:22:29.000000000 +1100
@@ -4143,6 +4143,9 @@
             break;
         if (gdth_search_eisa(eisa_slot)) {      /* controller found */
             shp = scsi_register(shtp,sizeof(gdth_ext_str));
+	    if(shp == NULL)
+		    continue;
+
             ha = HADATA(shp);
             if (!gdth_init_eisa(eisa_slot,ha)) {
                 scsi_unregister(shp);
-- 
  Don't blame me: the Monkey is driving
  File: Michael Still <mikal@stillhq.com>: [Trivial Patch] scsi_register-006

^ permalink raw reply

* [TRIVIAL] [Trivial Patch] scsi_register-004
From: Rusty Trivial Russell @ 2002-12-16 10:39 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Achim Leubner, linux-scsi

(Included in 2.5)
From:  Michael Still <mikal@stillhq.com>

  
  This patch has been generated as part of my scsi_register audit of the 2.5.45 kernel tree. scsi_register() can fail, returning a NULL pointer, and the failure case was not being handled here...
  
  
  
  

--- trivial-2.4.21-pre1/drivers/scsi/gdth.c.orig	2002-12-16 17:22:28.000000000 +1100
+++ trivial-2.4.21-pre1/drivers/scsi/gdth.c	2002-12-16 17:22:28.000000000 +1100
@@ -4029,6 +4029,9 @@
             break;
         if (gdth_search_isa(isa_bios)) {        /* controller found */
             shp = scsi_register(shtp,sizeof(gdth_ext_str));
+	    if(shp == NULL)
+		    continue;
+
             ha = HADATA(shp);
             if (!gdth_init_isa(isa_bios,ha)) {
                 scsi_unregister(shp);
-- 
  Don't blame me: the Monkey is driving
  File: Michael Still <mikal@stillhq.com>: [Trivial Patch] scsi_register-004

^ permalink raw reply

* [TRIVIAL] [Trivial Patch] scsi_register-002
From: Rusty Trivial Russell @ 2002-12-16 10:39 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: linux-scsi

(Included in 2.5)
From:  Michael Still <mikal@stillhq.com>

  
  This patch has been generated as part of my scsi_register audit of the 2.5.45 kernel tree. scsi_register() can fail, returning a NULL pointer, and the failure case was not being handled here...
  
  
  
  

--- trivial-2.4.21-pre1/drivers/scsi/aacraid/linit.c.orig	2002-12-16 17:22:28.000000000 +1100
+++ trivial-2.4.21-pre1/drivers/scsi/aacraid/linit.c	2002-12-16 17:22:28.000000000 +1100
@@ -203,6 +203,9 @@
 			 * specific information.
 			 */
 			host_ptr = scsi_register( template, sizeof(struct aac_dev) );
+			if(host_ptr == NULL)
+				continue;
+
 			/* 
 			 * These three parameters can be used to allow for wide SCSI 
 			 * and for host adapters that support multiple buses.
-- 
  Don't blame me: the Monkey is driving
  File: Michael Still <mikal@stillhq.com>: [Trivial Patch] scsi_register-002

^ permalink raw reply

* Re: aix7xxx_old woes in 2.5
From: Andrew Morton @ 2002-12-16 10:39 UTC (permalink / raw)
  To: Doug Ledford; +Cc: linux-scsi
In-Reply-To: <20021216074008.GC13989@redhat.com>

Doug Ledford wrote:
> 
> On Sat, Dec 14, 2002 at 08:36:25PM -0800, Andrew Morton wrote:
> >
> > ho hum.
> >
> > It just doesn't start at all:
> >
> > scsi HBA driver <NULL> didn't set max_sectors, please fix the template<6>(scsi0) <Adaptec AIC-7892 Ultra 160/m SCSI host adapter> found at PCI 3/4/0
> > (scsi0) Wide Channel, SCSI ID=7, 32/255 SCBs
> > (scsi0) Downloading sequencer code... 396 instructions downloaded
> > (scsi1) <Adaptec AIC-7880 Ultra SCSI host adapter> found at PCI 0/10/0
> > (scsi1) Wide Channel, SCSI ID=7, 16/255 SCBs
> > (scsi1) Downloading sequencer code... 436 instructions downloaded
> > scsi0 : Adaptec AHA274x/284x/294x (EISA/VLB/PCI-Fast SCSI) 5.2.6/5.2.0
> >        <Adaptec AIC-7892 Ultra 160/m SCSI host adapter>
> > scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 0 lun 0
> > scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 1 lun 0
> > scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 2 lun 0
> > scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 3 lun 0
> > scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 4 lun 0
> > scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 5 lun 0
> > scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 6 lun 0
> > scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 8 lun 0
> >
> > (The above took three minutes or more)
> 
> Interrupt routing problems is what that looks like to me, not driver
> problems.  Try booting with different interrupt settings or with a
> different kernel (smp vs. up, that sort of thing).

Uniprocessor, no IO-APIC.  No go:

           CPU0       
  0:     736412          XT-PIC  timer
  1:         15          XT-PIC  i8042
  2:          0          XT-PIC  cascade
  4:          0          XT-PIC  GDB-stub
  8:          1          XT-PIC  rtc
 11:        294          XT-PIC  ide2, ide3, ide4, ide5, aic7xxx, aic7xxx, eth0
 12:         52          XT-PIC  i8042
 14:       2848          XT-PIC  ide0
 15:          8          XT-PIC  ide1
NMI:          0 
ERR:          0

(Doesn't this rule out your theory?  If it's asserting the IRQ, we will
take an interrupt with this configuration?)

Uniprocessor, IO-APIC:

           CPU0       
  0:     654721    IO-APIC-edge  timer
  1:         15    IO-APIC-edge  i8042
  2:          0          XT-PIC  cascade
  4:          0    IO-APIC-edge  GDB-stub
  8:          1    IO-APIC-edge  rtc
 12:         55    IO-APIC-edge  i8042
 14:       2835    IO-APIC-edge  ide0
 15:         10    IO-APIC-edge  ide1
 19:         43   IO-APIC-level  ide2, ide3, ide4, ide5
 35:          0   IO-APIC-level  aic7xxx
 38:        296   IO-APIC-level  eth0
 58:        137   IO-APIC-level  aic7xxx
NMI:        668 
LOC:     654631 
ERR:          0
MIS:          0


I assume SMP/IO-APIC will do the same thing (takes too darn long
to go through them all).

Why should aic7xxx_old have this problem, and not aic7xxx?

Here's /proc/interrupts with aic7xxx, uniproc, IO-APIC:

           CPU0       
  0:      38650    IO-APIC-edge  timer
  1:         16    IO-APIC-edge  i8042
  2:          0          XT-PIC  cascade
  4:          0    IO-APIC-edge  GDB-stub
  8:          1    IO-APIC-edge  rtc
 12:         55    IO-APIC-edge  i8042
 14:       2726    IO-APIC-edge  ide0
 15:         10    IO-APIC-edge  ide1
 19:         43   IO-APIC-level  ide2, ide3, ide4, ide5
 35:        391   IO-APIC-level  aic7xxx
 38:        115   IO-APIC-level  eth0
 58:        284   IO-APIC-level  aic7xxx
NMI:         48 
LOC:      38516 
ERR:          0
MIS:          0

Just the same, only this time it's generating interrupts.
I don't think this is a mainboard problem.

The logs say:


scsi HBA driver <NULL> didn't set max_sectors, please fix the template
(scsi0) <Adaptec AIC-7892 Ultra 160/m SCSI host adapter> found at PCI 3/4/0
(scsi0) Wide Channel, SCSI ID=7, 32/255 SCBs
(scsi0) Downloading sequencer code... 396 instructions downloaded
(scsi1) <Adaptec AIC-7880 Ultra SCSI host adapter> found at PCI 0/10/0
(scsi1) Wide Channel, SCSI ID=7, 16/255 SCBs
(scsi1) Downloading sequencer code... 436 instructions downloaded
scsi0 : Adaptec AHA274x/284x/294x (EISA/VLB/PCI-Fast SCSI) 5.2.6/5.2.0
       <Adaptec AIC-7892 Ultra 160/m SCSI host adapter>
scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 0 lun 0
scsi: Device offlined - not ready or command retry failed after error recovery: host 0 channel 0 id 1 lun 0

Maybe the 7892 sequencer code is bust??

^ permalink raw reply

* Re: Intel sez: Synchronous Flash and XIP is the future -- thoughts?
From: Michal Schulz @ 2002-12-16 11:04 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: David Woodhouse, Paul Nash, Linux-MTD (E-mail)
In-Reply-To: <20021216092801.80539C6139@atlas.denx.de>

On Mon, 16 Dec 2002, Wolfgang Denk wrote:

> > With the chips available today and in the near future, XIP, at least for a
> > writable flash chip, makes virtually zero sense on Linux. Anyone who tries
> > to tell you otherwise is either on crack, trying to sell you something, or
> > both.
>
> Also you might find problems running recent (and future)  kernels  in
> XIP  mode  -  the kernel text segment is often not exactly read-only.
> Especially when you use one f the existing real-time extensions  (but
> not only then). It seems the amount of tweaking that is necessary for
> XIP  is  growing  with  each new kernel release - to a level where it
> becomes impractical.

With the XIP in kernel it is relatively simple with 2.2.x serie of
kernels. I have managed to put most of 2.2.18 kernel onto flash, where it
was executing from. The most problems are with .rodata section, which is
not read-only for kernel. It is so because some structures (one passed to
procfs for example) are created dynamically during function call, so they
can be later found in .rodata section.

After some play with arch/i386/vmlinux.lds.S it is possible to divide the
kernel into two parts. One is really read-only one and may reside anywhere
in memory (so for example in rom or in Flash) and the other one must be
copied from rom/flash into ram.

with XIP and runable applications, it makes sence when one operates with
2.5MB of real RAM or less. but it doesn't save too much because tons of
data are in writable sections. It is possible to fix romfs driver and
implement XIP there.

Please also note, that many flash memories are unreadable during write
cycles, so it makes no sence to execute linux kernel from them and using
some parts as a writable fs, because it causes immediate lock.

-- 
Michal Schulz

^ permalink raw reply

* Re: IDE-CD and VT8235 issue!!!
From: Vojtech Pavlik @ 2002-12-16 10:39 UTC (permalink / raw)
  To: Vojtech Pavlik
  Cc: Patrick Petermair, AnonimoVeneziano, Nicolas Mailhot,
	linux-kernel
In-Reply-To: <20021216113458.A31837@ucw.cz>

[-- Attachment #1: Type: text/plain, Size: 1309 bytes --]

On Mon, Dec 16, 2002 at 11:34:58AM +0100, Vojtech Pavlik wrote:
> On Sun, Dec 15, 2002 at 10:56:25PM +0100, Patrick Petermair wrote:
> > Vojtech Pavlik:
> > 
> > > You're not alone with this problem. I suspect some fishy stuff in the
> > > vt8235, because the driver programs it exactly the same as vt8233a,
> > > but while the vt8233a doesn't seem to have problems with DVDs and
> > > CDs, the vt8235 fails for many people.
> > 
> > Thanks for the info ... like I expected ...
> > 
> > > Can you send me 'hdparm -i' of the drive?
> > 
> > starbase:/# hdparm -i /dev/hdc
> > 
> > /dev/hdc:
> > 
> >  Model=TOSHIBA DVD-ROM SD-M1302, FwRev=1006, SerialNo=X900304741
> >  Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }
> >  RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
> >  BuffType=unknown, BuffSize=256kB, MaxMultSect=0
> >  (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0
> >  IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
> >  PIO modes:  pio0 pio1 pio2 pio3 pio4 
> >  DMA modes:  sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 
> >  UDMA modes: udma0 udma1 *udma2 
> >  AdvancedPM=no
> > 
> > Thanks for all your effort here. It's great to see such a good 
> > community.
> 
> If you can, please try 2.4.20 with this patch.

Patch attached now.

-- 
Vojtech Pavlik
SuSE Labs

[-- Attachment #2: vt8235-dvd --]
[-- Type: text/plain, Size: 2412 bytes --]

ChangeSet@1.884, 2002-12-16 11:00:04+01:00, vojtech@suse.cz
  Workaround problems with vt8235 and certain CD/DVD-ROMs.


 via82cxxx.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)


diff -Nru a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
--- a/drivers/ide/pci/via82cxxx.c	Mon Dec 16 11:33:37 2002
+++ b/drivers/ide/pci/via82cxxx.c	Mon Dec 16 11:33:37 2002
@@ -67,6 +67,7 @@
 #define VIA_SET_FIFO		0x040	/* Needs to have FIFO split set */
 #define VIA_NO_UNMASK		0x080	/* Doesn't work with IRQ unmasking on */
 #define VIA_BAD_ID		0x100	/* Has wrong vendor ID (0x1107) */
+#define VIA_NO_CMD_AS		0x200	/* Don't program command and address setup timings */
 
 /*
  * VIA SouthBridge chips.
@@ -80,10 +81,10 @@
 	u16 flags;
 } via_isa_bridges[] = {
 #ifdef FUTURE_BRIDGES
-	{ "vt8237",	PCI_DEVICE_ID_VIA_8237,     0x00, 0x2f, VIA_UDMA_133 },
+	{ "vt8237",	PCI_DEVICE_ID_VIA_8237,     0x00, 0x2f, VIA_UDMA_133 | VIA_NO_CMD_AS },
 #endif
-	{ "vt8235",	PCI_DEVICE_ID_VIA_8235,     0x00, 0x2f, VIA_UDMA_133 },
-	{ "vt8233a",	PCI_DEVICE_ID_VIA_8233A,    0x00, 0x2f, VIA_UDMA_133 },
+	{ "vt8235",	PCI_DEVICE_ID_VIA_8235,     0x00, 0x2f, VIA_UDMA_133 | VIA_NO_CMD_AS },
+	{ "vt8233a",	PCI_DEVICE_ID_VIA_8233A,    0x00, 0x2f, VIA_UDMA_133 | VIA_NO_CMD_AS },
 	{ "vt8233c",	PCI_DEVICE_ID_VIA_8233C_0,  0x00, 0x2f, VIA_UDMA_100 },
 	{ "vt8233",	PCI_DEVICE_ID_VIA_8233_0,   0x00, 0x2f, VIA_UDMA_100 },
 	{ "vt8231",	PCI_DEVICE_ID_VIA_8231,     0x00, 0x2f, VIA_UDMA_100 },
@@ -292,12 +293,15 @@
 {
 	u8 t;
 
-	pci_read_config_byte(dev, VIA_ADDRESS_SETUP, &t);
-	t = (t & ~(3 << ((3 - dn) << 1))) | ((FIT(timing->setup, 1, 4) - 1) << ((3 - dn) << 1));
-	pci_write_config_byte(dev, VIA_ADDRESS_SETUP, t);
+	if (~via_config->flags & VIA_NO_CMD_AS) {
+
+		pci_read_config_byte(dev, VIA_ADDRESS_SETUP, &t);
+		t = (t & ~(3 << ((3 - dn) << 1))) | ((FIT(timing->setup, 1, 4) - 1) << ((3 - dn) << 1));
+		pci_write_config_byte(dev, VIA_ADDRESS_SETUP, t);
 
-	pci_write_config_byte(dev, VIA_8BIT_TIMING + (1 - (dn >> 1)),
-		((FIT(timing->act8b, 1, 16) - 1) << 4) | (FIT(timing->rec8b, 1, 16) - 1));
+		pci_write_config_byte(dev, VIA_8BIT_TIMING + (1 - (dn >> 1)),
+			((FIT(timing->act8b, 1, 16) - 1) << 4) | (FIT(timing->rec8b, 1, 16) - 1));
+	}
 
 	pci_write_config_byte(dev, VIA_DRIVE_TIMING + (3 - dn),
 		((FIT(timing->active, 1, 16) - 1) << 4) | (FIT(timing->recover, 1, 16) - 1));

^ permalink raw reply

* Re: 6/19
From: Tomas Szepe @ 2002-12-16 10:38 UTC (permalink / raw)
  To: Joe Thornber; +Cc: Linus Torvalds, Kernel Mailing List
In-Reply-To: <20021216103558.GA20223@louise.pinerecords.com>

> > +	/*
> > +	 * chunk_size is a power of two
> > +	 */
> > +	if (!chunk_size || (chunk_size & (chunk_size - 1))) {
> > +		ti->error = "dm-stripe: Invalid chunk size";
> > +		return -EINVAL;
> > +	}
> 
> Is 1 a valid chunksize then?  [It certainly is not a power of two. ;)]

Umm, 2 ^ 0 = 1.  Sorry.

-- 
Tomas Szepe <szepe@pinerecords.com>

^ permalink raw reply

* Re: 6/19
From: Tomas Szepe @ 2002-12-16 10:35 UTC (permalink / raw)
  To: Joe Thornber; +Cc: Linus Torvalds, Kernel Mailing List
In-Reply-To: <20021216100947.GG7407@reti>

> +	/*
> +	 * chunk_size is a power of two
> +	 */
> +	if (!chunk_size || (chunk_size & (chunk_size - 1))) {
> +		ti->error = "dm-stripe: Invalid chunk size";
> +		return -EINVAL;
> +	}

Is 1 a valid chunksize then?  [It certainly is not a power of two. ;)]
If not, you need

	if (chink_size < 2 || (chunk_size & (chunk_size - 1))) { ... }

-- 
Tomas Szepe <szepe@pinerecords.com>

^ permalink raw reply

* Re: IDE-CD and VT8235 issue!!!
From: Vojtech Pavlik @ 2002-12-16 10:34 UTC (permalink / raw)
  To: Patrick Petermair, AnonimoVeneziano, Nicolas Mailhot
  Cc: linux-kernel, Vojtech Pavlik
In-Reply-To: <200212152256.25266.black666@inode.at>

On Sun, Dec 15, 2002 at 10:56:25PM +0100, Patrick Petermair wrote:
> Vojtech Pavlik:
> 
> > You're not alone with this problem. I suspect some fishy stuff in the
> > vt8235, because the driver programs it exactly the same as vt8233a,
> > but while the vt8233a doesn't seem to have problems with DVDs and
> > CDs, the vt8235 fails for many people.
> 
> Thanks for the info ... like I expected ...
> 
> > Can you send me 'hdparm -i' of the drive?
> 
> starbase:/# hdparm -i /dev/hdc
> 
> /dev/hdc:
> 
>  Model=TOSHIBA DVD-ROM SD-M1302, FwRev=1006, SerialNo=X900304741
>  Config={ Fixed Removeable DTR<=5Mbs DTR>10Mbs nonMagnetic }
>  RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0
>  BuffType=unknown, BuffSize=256kB, MaxMultSect=0
>  (maybe): CurCHS=0/0/0, CurSects=0, LBA=yes, LBAsects=0
>  IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
>  PIO modes:  pio0 pio1 pio2 pio3 pio4 
>  DMA modes:  sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 
>  UDMA modes: udma0 udma1 *udma2 
>  AdvancedPM=no
> 
> Thanks for all your effort here. It's great to see such a good 
> community.

If you can, please try 2.4.20 with this patch.

-- 
Vojtech Pavlik
SuSE Labs

^ permalink raw reply

* Re: installing Predict on a RedHat 7.3 box , no go :^(
From: Matti Aarnio @ 2002-12-16 10:26 UTC (permalink / raw)
  To: Douglas Cole; +Cc: linux-hams
In-Reply-To: <200212151628.02870.n7bfs@qwest.net>

On Sun, Dec 15, 2002 at 04:28:02PM -0800, Douglas Cole wrote:
...
> BUT , it will not even begin to install :^(
> here is what I get when I try to run ./configure on the RedHat box...
> 
> [root@n7bfs predict-2.2.1]# ./configure
> One moment please... installer.c:16:20: curses.h: No such file or directory
> Compilation failed.  Are you sure you have a C compiler (gcc) installed?
> [root@n7bfs predict-2.2.1]#

  You do need   ncurses-devel  package.

...
> tia for any input!
> -- 
> Douglas Cole   N7BFS

73 de Matti Aarnio, OH1MQK

^ permalink raw reply

* [U-Boot-Users] Automatic boot of Linux from flash (Big ppcboot image the sequel)
From: "Callebaut, Benoît" @ 2002-12-16 10:24 UTC (permalink / raw)
  To: u-boot

Hi, 
I tried another approach to boot directly Linux ,from flash from an image
loaded in flash in one block.
Instead of compiling ppcboot with an image of the linux kernel in a big
array ( makes linking problem)
I placed the kernel image direcltly after the ppcboot image with the (linux)
command cat image >> ppcboot.bin.
With the offset of the kernel and its length hardcoded no problem everything
start.
But when I use the function get_endaddr() (before relocation of course) It
give me back an address approximatively 30 kBytes after the real end of
ppcboot.
Second problem, How can I find back or make ppcboot find the end of the
Kernel image without anything hardcoded ? 
----------------------------------------------------------------------------
------
Benoit Callebaut
Software Development Engineer
Barco | Control Rooms
Noordlaan 5, 8520 Kuurne, Belgium
 
Tel 	+32(0)56 36 84 28
Fax 	+32(0)56 36 86 05

mailto:benoit.callebaut at barco.com
http://www.barcocontrolrooms.com

^ permalink raw reply

* Re: Linux v2.5.52
From: Christoph Hellwig @ 2002-12-16 10:26 UTC (permalink / raw)
  To: Linus Torvalds, bcollins; +Cc: Kernel Mailing List
In-Reply-To: <Pine.LNX.4.44.0212151930120.12906-100000@penguin.transmeta.com>

On Sun, Dec 15, 2002 at 07:34:09PM -0800, Linus Torvalds wrote:
> Ben Collins <bcollins@debian.org>:
>   o IEEE-1394/Firewire update

This merge looks fishy.  It seems to be yet another let's throw my CVS
repo in merge and backs out Al's work yo get rid of lots of devfs crap.

It also contains strange changes like:

-	ch = kmalloc(sizeof *ch, SLAB_KERNEL);
+	ch = kmalloc(sizeof *ch, in_interrupt() ? SLAB_ATOMIC : SLAB_KERNEL);

that really want proper fixing.


^ permalink raw reply

* Re: possible problems with rc6 aplay
From: Martin Langer @ 2002-12-16 10:17 UTC (permalink / raw)
  To: Mark Knecht; +Cc: paul, alsa-devel, swpatrick
In-Reply-To: <1040013536.2187.4.camel@Godzilla>

On Sun, Dec 15, 2002 at 08:38:54PM -0800, Mark Knecht wrote:
> Paul,
>    I'm using two Hammerfalls in separate boxes. Please try to come up
> with a solution, either automatically or by asking questions in some
> configuration process, that allows two Linux boxes to choose which to
> make the master. It is important in my case.
> 

What about the amixer switch? You can use it for switching between master,
world, ... modes, but I have only small personal experiences with external
hardware using rme32.

Another problem I see is the frequency of your master mode. In my opinion
you can't set your card to master mode without defining it's frequency
before. On rme32 I have three master three modes (32/44.1/48 kHz). If you
have a freshly loaded driver and switch to master mode at first it's output
frquency is totally undefined. But if you play at first some audio stuff
with your rme32 it's no problem and the card uses this last frequency.

But using master clock mode without defining a frequency before isn't
plausible for me and defining one master mode for each frequency was only a
quick solution by me.

Any comments or better solutions?

martin


> Thanks,
> Mark
> 
> On Sun, 2002-12-15 at 19:13, Paul Davis wrote:
> > >Latency: 4096 samples (2 periods of 16384 bytes)
> > >Hardware pointer (frames): 0
> > >Passthru: no
> > >Clock mode: autosync
> > >Pref. sync source: ADAT1
> > >
> > >IEC958 input: Coaxial
> > >IEC958 output: Coaxial only
> > >IEC958 quality: Consumer
> > >IEC958 emphasis: off
> > >IEC958 Dolby: off
> > >IEC958 sample rate: error flag set
> > >
> > >ADAT Sample rate: 44100Hz
> > 
> > if you're hammerfall is configured as shown above (and no, the name
> > change makes no difference), then the SR that it uses will be
> > determined by your external converter connected to the first ADAT
> > port. nothing that ALSA does (or any program using ALSA does) will
> > alter the SR. thats because you are synced to ADAT1, not the card's
> > internal clock, thus the SR is determined by the clock signal arriving
> > at ADAT1, which presumably comes from a converter somewhere back up
> > the ADAT chain.
> > 
> > its been on my to-do list for some time to make "master" the default
> > clock mode on the hammerfall, which avoids any ambiguity about the
> > sample rate used by the card. i've held back because its really not
> > the right option for most studio-ish users, who have external
> > converters that probably have rate switches on them and they expect
> > the hammerfall to follow the switch setting.
> > 
> > does any of this make it any clearer? its really a bit of problem that
> > the rate setting code doesn't do a full 100% check on all this
> > stuff. an app can set the rate to 44100, and appear to have succeeded,
> > but it will have no difference on the actual rate if the sync source
> > is not the clock's internal clock. this is true, btw, for most digital
> > cards. if you tried to record at 44100, but your external converters
> > were running at 48kHz (as you suggest they have been), then the
> > recordings will be at 48kHz with the sync source set as shown above.
> > 
> > --p
> > 
> > 
> > 
> > 
> > -------------------------------------------------------
> > This sf.net email is sponsored by:
> > With Great Power, Comes Great Responsibility 
> > Learn to use your power at OSDN's High Performance Computing Channel
> > http://hpc.devchannel.org/
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/alsa-devel
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:
> With Great Power, Comes Great Responsibility 
> Learn to use your power at OSDN's High Performance Computing Channel
> http://hpc.devchannel.org/
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
> 
> 

-- 
"2b|!2b"


-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/

^ permalink raw reply

* Re: tc and iptables
From: Cedric Blancher @ 2002-12-16 10:15 UTC (permalink / raw)
  To: nimit; +Cc: netfilter
In-Reply-To: <3DF6C4D3.6040109@deeeproot.co.in>

Le mer 11/12/2002 à 05:53, nimit a écrit :
> 	i am new to netfilter, just learning to use iptables and tc, but i am 
> not clear which one is more suitable for bytelimiting purpose.

Well... See LARTC at http://lartc.org/...

Netfilter is a packet filter, which is suitable for filtering network
flows.
tc is a traffic control utility, which is suitable for controling
traffic behaviour, so bytelimiting purposes.

Netfilter's limit match is _not_ suitable for traffic shaping, as said
in Filtergin HOWTO.

-- 
Cédric Blancher  <blancher@cartel-securite.fr>
Consultant en sécurité des systèmes et réseaux  - Cartel Sécurité
Tél: +33 (0)1 44 06 97 87 - Fax: +33 (0)1 44 06 97 99
PGP KeyID:157E98EE  FingerPrint:FA62226DA9E72FA8AECAA240008B480E157E98EE


^ permalink raw reply

* [BENCHMARK] LM bench results summary for 52-mm1 patch
From: Aniruddha M Marathe @ 2002-12-16 10:18 UTC (permalink / raw)
  To: linux-kernel

Hi,
Here is a brief summary of results of LM bench on kernel 2.5.52

								2.5.52-mm1	 	2.5.51
==============================================================================
Processor, Processes - times in microseconds - smaller is better

1. Null call						0.44			0.46
2. open close			 			30			28
3. single handle						5.13			5.22
4. fork proc						400			363
5. sh proc							8279			7967
------------------------------------------------------------------------------
*Local* Communication latencies in microseconds - smaller is better
1. TCP connection						174		161
------------------------------------------------------------------------------
File & VM system latencies in microseconds - smaller is better
1. 0K file delete						60		57
2. mmap latency						615		640
------------------------------------------------------------------------------
==============================================================================

Rest of the results are not much different.
	

                 L M B E N C H  2 . 0   S U M M A R Y
                 ------------------------------------
		 (Alpha software, do not distribute)

Basic system parameters
----------------------------------------------------
Host                 OS Description              Mhz
                                                    
--------- ------------- ----------------------- ----
benchtest  Linux 2.5.52       i686-pc-linux-gnu  790
benchtest  Linux 2.5.52       i686-pc-linux-gnu  790
benchtest  Linux 2.5.52       i686-pc-linux-gnu  790
benchtest  Linux 2.5.52       i686-pc-linux-gnu  790
benchtest  Linux 2.5.52       i686-pc-linux-gnu  790

Processor, Processes - times in microseconds - smaller is better
----------------------------------------------------------------
Host                 OS  Mhz null null      open selct sig  sig  fork exec sh  
                             call  I/O stat clos TCP   inst hndl proc proc proc
--------- ------------- ---- ---- ---- ---- ---- ----- ---- ---- ---- ---- ----
benchtest  Linux 2.5.52  790 0.44 0.81   28   30       1.30 5.13  355 1581 8185
benchtest  Linux 2.5.52  790 0.44 0.83   28   30    36 1.31 5.13  400 1570 8247
benchtest  Linux 2.5.52  790 0.44 0.81   28   30    32 1.29 5.35  401 1584 8336
benchtest  Linux 2.5.52  790 0.46 0.83   28   30    37 1.28 5.13  404 1591 8277
benchtest  Linux 2.5.52  790 0.44 0.80   28   30    32 1.28 5.12  370 1572 8279

Context switching - times in microseconds - smaller is better
-------------------------------------------------------------
Host                 OS 2p/0K 2p/16K 2p/64K 8p/16K 8p/64K 16p/16K 16p/64K
                        ctxsw  ctxsw  ctxsw ctxsw  ctxsw   ctxsw   ctxsw
--------- ------------- ----- ------ ------ ------ ------ ------- -------
benchtest  Linux 2.5.52 1.350 4.9900     14 9.6200    176      46     177
benchtest  Linux 2.5.52 1.290 4.6000     15 8.0900    179      42     179
benchtest  Linux 2.5.52 1.190 4.8300     14 7.3500    177      44     179
benchtest  Linux 2.5.52 1.190 4.5800     17 7.4400    184      42     180
benchtest  Linux 2.5.52 1.340 4.6200     16 9.1900    181      39     180

*Local* Communication latencies in microseconds - smaller is better
-------------------------------------------------------------------
Host                 OS 2p/0K  Pipe AF     UDP  RPC/   TCP  RPC/ TCP
                        ctxsw       UNIX         UDP         TCP conn
--------- ------------- ----- ----- ---- ----- ----- ----- ----- ----
benchtest  Linux 2.5.52 1.350 7.875   21    34    59   128   158  174
benchtest  Linux 2.5.52 1.290 7.961   21    35    59   126   159  174
benchtest  Linux 2.5.52 1.190 7.982   21    34    60   127   160  175
benchtest  Linux 2.5.52 1.190 8.239   21    34    60   125   159  176
benchtest  Linux 2.5.52 1.340 7.952   21    34    60   125   158  175

File & VM system latencies in microseconds - smaller is better
--------------------------------------------------------------
Host                 OS   0K File      10K File      Mmap    Prot    Page	
                        Create Delete Create Delete  Latency Fault   Fault 
--------- ------------- ------ ------ ------ ------  ------- -----   ----- 
benchtest  Linux 2.5.52    120     60    384    130      640 1.124 5.00000
benchtest  Linux 2.5.52    120     60    396    130      646 1.095 4.00000
benchtest  Linux 2.5.52    120     60    384    126      637 0.803 4.00000
benchtest  Linux 2.5.52    121     60    385    130      644 1.090 4.00000
benchtest  Linux 2.5.52    120     60    385    122      635 1.032 4.00000

*Local* Communication bandwidths in MB/s - bigger is better
-----------------------------------------------------------
Host                OS  Pipe AF    TCP  File   Mmap  Bcopy  Bcopy  Mem   Mem
                             UNIX      reread reread (libc) (hand) read write
--------- ------------- ---- ---- ---- ------ ------ ------ ------ ---- -----
benchtest  Linux 2.5.52  337  135   22    298    355    124    113  355   171
benchtest  Linux 2.5.52  447  134   22    293    353    123    112  354   169
benchtest  Linux 2.5.52  422  136   22    293    353    123    112  354   169
benchtest  Linux 2.5.52  445  135   22    295    353    123    113  354   169
benchtest  Linux 2.5.52  450  134   22    294    352    123    112  353   169

Memory latencies in nanoseconds - smaller is better
    (WARNING - may not be correct, check graphs)
---------------------------------------------------
Host                 OS   Mhz  L1 $   L2 $    Main mem    Guesses
--------- -------------  ---- ----- ------    --------    -------
benchtest  Linux 2.5.52   790 3.807 8.8730    174
benchtest  Linux 2.5.52   790 3.799 8.8760    175
benchtest  Linux 2.5.52   790 3.808 8.8840    175
benchtest  Linux 2.5.52   790 3.801 8.8730    176
benchtest  Linux 2.5.52   790 3.809 8.8720    176

Regards,
Aniruddha Marathe
WIPRO Technologies, India
Aniruddha.marathe@wipro.com

^ permalink raw reply

* 19/19
From: Joe Thornber @ 2002-12-16 10:19 UTC (permalink / raw)
  To: Joe Thornber; +Cc: Linus Torvalds, Kernel Mailing List
In-Reply-To: <20021216100457.GA7407@reti>

The linear target was getting the start sector wrong when doing a
dm_get_device(). [Kevin Corry]
--- diff/drivers/md/dm-linear.c	2002-11-18 10:11:54.000000000 +0000
+++ source/drivers/md/dm-linear.c	2002-12-16 09:43:39.000000000 +0000
@@ -43,7 +43,7 @@
 		goto bad;
 	}
 
-	if (dm_get_device(ti, argv[0], ti->begin, ti->len,
+	if (dm_get_device(ti, argv[0], lc->start, ti->len,
 			  dm_table_get_mode(ti->table), &lc->dev)) {
 		ti->error = "dm-linear: Device lookup failed";
 		goto bad;

^ permalink raw reply

* 18/19
From: Joe Thornber @ 2002-12-16 10:18 UTC (permalink / raw)
  To: Joe Thornber; +Cc: Linus Torvalds, Kernel Mailing List
In-Reply-To: <20021216100457.GA7407@reti>

The block layer does not honour bio->bi_size when issuing io, instead
it performs io to the complete bvecs.  This means we have to change
the bio splitting code slightly.

Given a bio we repeatedly apply one of the following three operations
until there is no more io left in the bio:

1) The remaining io does not cross an io/target boundary, so just
   create a clone and issue all of the io.

2) There are some bvecs at the start of the bio that are not split by
   a target boundary.  Create a clone for these bvecs only.

3) The first bvec needs splitting, use bio_alloc() to create *two*
   bios, one for the first half of the bvec, the other for the second
   half.  A bvec can never contain more than one boundary.
--- diff/drivers/md/dm.c	2002-12-16 09:41:39.000000000 +0000
+++ source/drivers/md/dm.c	2002-12-16 09:42:31.000000000 +0000
@@ -228,6 +228,15 @@
  *   interests of getting something for people to use I give
  *   you this clearly demarcated crap.
  *---------------------------------------------------------------*/
+static inline sector_t to_sector(unsigned int bytes)
+{
+	return bytes >> SECTOR_SHIFT;
+}
+
+static inline unsigned int to_bytes(sector_t sector)
+{
+	return sector << SECTOR_SHIFT;
+}
 
 /*
  * Decrements the number of outstanding ios that a bio has been
@@ -270,16 +279,17 @@
 static sector_t max_io_len(struct mapped_device *md,
 			   sector_t sector, struct dm_target *ti)
 {
-	sector_t len = ti->len;
+	sector_t offset = sector - ti->begin;
+	sector_t len = ti->len - offset;
 
 	/* FIXME: obey io_restrictions ! */
 
+
 	/*
 	 * Does the target need to split even further ?
 	 */
 	if (ti->split_io) {
 		sector_t boundary;
-		sector_t offset = sector - ti->begin;
 		boundary = dm_round_up(offset + 1, ti->split_io) - offset;
 
 		if (len > boundary)
@@ -289,16 +299,17 @@
 	return len;
 }
 
-static void __map_bio(struct dm_target *ti, struct bio *clone)
+static void __map_bio(struct dm_target *ti, struct bio *clone, struct dm_io *io)
 {
-	struct dm_io *io = clone->bi_private;
 	int r;
 
 	/*
 	 * Sanity checks.
 	 */
-	if (!clone->bi_size)
-		BUG();
+	BUG_ON(!clone->bi_size);
+
+	clone->bi_end_io = clone_endio;
+	clone->bi_private = io;
 
 	/*
 	 * Map the clone.  If r == 0 we don't need to do
@@ -326,77 +337,125 @@
 };
 
 /*
- * Issues a little bio that just does the back end of a split page.
+ * Creates a little bio that is just does part of a bvec.
  */
-static void __split_page(struct clone_info *ci, unsigned int len)
+static struct bio *split_bvec(struct bio *bio, sector_t sector,
+			      unsigned short idx, unsigned int offset,
+			      unsigned int len)
 {
-	struct dm_target *ti = dm_table_find_target(ci->md->map, ci->sector);
-	struct bio *clone, *bio = ci->bio;
-	struct bio_vec *bv = bio->bi_io_vec + ci->idx;
-
-	if (len > ci->sector_count)
-		len = ci->sector_count;
+	struct bio *clone;
+	struct bio_vec *bv = bio->bi_io_vec + idx;
 
 	clone = bio_alloc(GFP_NOIO, 1);
-	memcpy(clone->bi_io_vec, bv, sizeof(*bv));
 
-	clone->bi_sector = ci->sector;
-	clone->bi_bdev = bio->bi_bdev;
-	clone->bi_rw = bio->bi_rw;
-	clone->bi_vcnt = 1;
-	clone->bi_size = len << SECTOR_SHIFT;
-	clone->bi_end_io = clone_endio;
-	clone->bi_private = ci->io;
-	clone->bi_io_vec->bv_offset = bv->bv_len - clone->bi_size;
-	clone->bi_io_vec->bv_len = clone->bi_size;
+	if (clone) {
+		memcpy(clone->bi_io_vec, bv, sizeof(*bv));
 
-	ci->sector += len;
-	ci->sector_count -= len;
+		clone->bi_sector = sector;
+		clone->bi_bdev = bio->bi_bdev;
+		clone->bi_rw = bio->bi_rw;
+		clone->bi_vcnt = 1;
+		clone->bi_size = to_bytes(len);
+		clone->bi_io_vec->bv_offset = offset;
+		clone->bi_io_vec->bv_len = clone->bi_size;
+	}
 
-	__map_bio(ti, clone);
+	return clone;
+}
+
+/*
+ * Creates a bio that consists of range of complete bvecs.
+ */
+static struct bio *clone_bio(struct bio *bio, sector_t sector,
+			     unsigned short idx, unsigned short bv_count,
+			     unsigned int len)
+{
+	struct bio *clone;
+
+	clone = bio_clone(bio, GFP_NOIO);
+	clone->bi_sector = sector;
+	clone->bi_idx = idx;
+	clone->bi_vcnt = idx + bv_count;
+	clone->bi_size = to_bytes(len);
+
+	return clone;
 }
 
 static void __clone_and_map(struct clone_info *ci)
 {
 	struct bio *clone, *bio = ci->bio;
 	struct dm_target *ti = dm_table_find_target(ci->md->map, ci->sector);
-	sector_t len = max_io_len(ci->md, bio->bi_sector, ti);
+	sector_t len = 0, max = max_io_len(ci->md, ci->sector, ti);
 
-	/* shorter than current target ? */
-	if (ci->sector_count < len)
-		len = ci->sector_count;
+	if (ci->sector_count <= max) {
+		/*
+		 * Optimise for the simple case where we can do all of
+		 * the remaining io with a single clone.
+		 */
+		clone = clone_bio(bio, ci->sector, ci->idx,
+				  bio->bi_vcnt - ci->idx, ci->sector_count);
+		__map_bio(ti, clone, ci->io);
+		ci->sector_count = 0;
 
-	/* create the clone */
-	clone = bio_clone(ci->bio, GFP_NOIO);
-	clone->bi_sector = ci->sector;
-	clone->bi_idx = ci->idx;
-	clone->bi_size = len << SECTOR_SHIFT;
-	clone->bi_end_io = clone_endio;
-	clone->bi_private = ci->io;
+	} else if (to_sector(bio->bi_io_vec[ci->idx].bv_len) <= max) {
+		/*
+		 * There are some bvecs that don't span targets.
+		 * Do as many of these as possible.
+		 */
+		int i;
+		sector_t remaining = max;
+		sector_t bv_len;
 
-	/* adjust the remaining io */
-	ci->sector += len;
-	ci->sector_count -= len;
-	__map_bio(ti, clone);
+		for (i = ci->idx; remaining && (i < bio->bi_vcnt); i++) {
+			bv_len = to_sector(bio->bi_io_vec[i].bv_len);
 
-	/*
-	 * If we are not performing all remaining io in this
-	 * clone then we need to calculate ci->idx for the next
-	 * time round.
-	 */
-	if (ci->sector_count) {
-		while (len) {
-			struct bio_vec *bv = clone->bi_io_vec + ci->idx;
-			sector_t bv_len = bv->bv_len >> SECTOR_SHIFT;
-			if (bv_len <= len)
-				len -= bv_len;
+			if (bv_len > remaining)
+				break;
 
-			else {
-				__split_page(ci, bv_len - len);
-				len = 0;
-			}
-			ci->idx++;
+			remaining -= bv_len;
+			len += bv_len;
 		}
+
+		clone = clone_bio(bio, ci->sector, ci->idx, i - ci->idx, len);
+		__map_bio(ti, clone, ci->io);
+
+		ci->sector += len;
+		ci->sector_count -= len;
+		ci->idx = i;
+
+	} else {
+		/*
+		 * Create two copy bios to deal with io that has
+		 * been split across a target.
+		 */
+		struct bio_vec *bv = bio->bi_io_vec + ci->idx;
+
+		clone = split_bvec(bio, ci->sector, ci->idx,
+				   bv->bv_offset, max);
+		if (!clone) {
+			dec_pending(ci->io, -ENOMEM);
+			return;
+		}
+
+		__map_bio(ti, clone, ci->io);
+
+		ci->sector += max;
+		ci->sector_count -= max;
+		ti = dm_table_find_target(ci->md->map, ci->sector);
+
+		len = to_sector(bv->bv_len) - max;
+		clone = split_bvec(bio, ci->sector, ci->idx,
+				   bv->bv_offset + to_bytes(max), len);
+		if (!clone) {
+			dec_pending(ci->io, -ENOMEM);
+			return;
+		}
+
+		__map_bio(ti, clone, ci->io);
+
+		ci->sector += len;
+		ci->sector_count -= len;
+		ci->idx++;
 	}
 }
 

^ permalink raw reply

* 17/19
From: Joe Thornber @ 2002-12-16 10:17 UTC (permalink / raw)
  To: Joe Thornber; +Cc: Linus Torvalds, Kernel Mailing List
In-Reply-To: <20021216100457.GA7407@reti>

o  If there's an error you still need to call bio_endio with bio->bi_size
   as the 'done' param.

o  Simplify clone_endio.

[Kevin Corry]
--- diff/drivers/md/dm.c	2002-12-16 09:41:34.000000000 +0000
+++ source/drivers/md/dm.c	2002-12-16 09:41:39.000000000 +0000
@@ -249,7 +249,7 @@
 			/* nudge anyone waiting on suspend queue */
 			wake_up(&io->md->wait);
 
-		bio_endio(io->bio, io->error ? 0 : io->bio->bi_size, io->error);
+		bio_endio(io->bio, io->bio->bi_size, io->error);
 		free_io(io->md, io);
 	}
 }
@@ -258,16 +258,11 @@
 {
 	struct dm_io *io = bio->bi_private;
 
-	/*
-	 * Only call dec_pending if the clone has completely
-	 * finished.  If a partial io errors I'm assuming it won't
-	 * be requeued.  FIXME: check this.
-	 */
-	if (error || !bio->bi_size) {
-		dec_pending(io, error);
-		bio_put(bio);
-	}
+	if (bio->bi_size)
+		return 1;
 
+	dec_pending(io, error);
+	bio_put(bio);
 	return 0;
 }
 
@@ -454,13 +449,13 @@
 		up_read(&md->lock);
 
 		if (bio_rw(bio) == READA) {
-			bio_io_error(bio, 0);
+			bio_io_error(bio, bio->bi_size);
 			return 0;
 		}
 
 		r = queue_io(md, bio);
 		if (r < 0) {
-			bio_io_error(bio, 0);
+			bio_io_error(bio, bio->bi_size);
 			return 0;
 
 		} else if (r == 0)

^ permalink raw reply

* 16/19
From: Joe Thornber @ 2002-12-16 10:16 UTC (permalink / raw)
  To: Joe Thornber; +Cc: Linus Torvalds, Kernel Mailing List
In-Reply-To: <20021216100457.GA7407@reti>

Remove verbose debug message 'Splitting page'.
--- diff/drivers/md/dm.c	2002-12-16 09:41:25.000000000 +0000
+++ source/drivers/md/dm.c	2002-12-16 09:41:34.000000000 +0000
@@ -339,8 +339,6 @@
 	struct bio *clone, *bio = ci->bio;
 	struct bio_vec *bv = bio->bi_io_vec + ci->idx;
 
-	DMWARN("splitting page");
-
 	if (len > ci->sector_count)
 		len = ci->sector_count;
 

^ permalink raw reply

* 15/19
From: Joe Thornber @ 2002-12-16 10:16 UTC (permalink / raw)
  To: Joe Thornber; +Cc: Linus Torvalds, Kernel Mailing List
In-Reply-To: <20021216100457.GA7407@reti>

Remove some paranoia in highmem.c
--- diff/mm/highmem.c	2002-11-11 11:09:43.000000000 +0000
+++ source/mm/highmem.c	2002-12-16 09:41:30.000000000 +0000
@@ -452,8 +452,6 @@
 	mempool_t *pool;
 	int bio_gfp;
 
-	BUG_ON((*bio_orig)->bi_idx);
-
 	/*
 	 * for non-isa bounce case, just check if the bounce pfn is equal
 	 * to or bigger than the highest pfn in the system -- in that case,

^ permalink raw reply


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.