Plan 9 from Bell Labs’s /usr/web/sources/patch/sorry/ether8169jumbo/diff

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


55a56
> 	Coal		= 0xE2,		/* Interrupt Mitigation (Coalesce) */
57c58
< 	Mtps		= 0xEC,		/* Max. Transmit Packet Size */
---
> 	Etx		= 0xEC,		/* Early Transmit Threshold */
183c184
< 	Lgsen		= 0x08000000,	/* Large Send */
---
> 	Lgsen		= 0x08000000,	/* TSO; WARNING: contains lark's vomit */
187,188c188
< 	RxflMASK	= 0x00003FFF,	/* Receive Frame Length */
< 	RxflSHIFT	= 0,
---
> 	RxflMASK	= 0x00001FFF,	/* Receive Frame Length */
215,216c215,216
< 	Ntd		= 32,		/* Transmit Ring */
< 	Nrd		= 128,		/* Receive Ring */
---
> 	Ntd		= 64,		/* Transmit Ring */
> 	Nrd		= 256,		/* Receive Ring */
218c218,221
< 	Mps		= ROUNDUP(ETHERMAXTU+4, 128),
---
> 	Stdbuf		= 1536,
> 	Mtu		= 7000,		/* performance limited */
> 	Mps		= Mtu+8+14,	/* if(mtu>ETHERMAXTU) */
> //	Mps		= ROUNDUP(ETHERMAXTU+4, 128),
276c279
< 	int	mtps;			/* Max. Transmit Packet Size */
---
> //	int	rbsz;			/* receive buffer size */
303a307
> 	uint	frag;			/* partial packets; rb was too small */
487c491
< 	char *p;
---
> 	char *p0, *p, *e;
490c494
< 	int i, l, r, timeo;
---
> 	int i, r, timeo;
525c529
< 	if((p = malloc(READSTR)) == nil)
---
> 	if((p = p0 = malloc(READSTR)) == nil)
526a531
> 	e = p+READSTR;
528,540c533,545
< 	l = snprint(p, READSTR, "TxOk: %llud\n", dtcc->txok);
< 	l += snprint(p+l, READSTR-l, "RxOk: %llud\n", dtcc->rxok);
< 	l += snprint(p+l, READSTR-l, "TxEr: %llud\n", dtcc->txer);
< 	l += snprint(p+l, READSTR-l, "RxEr: %ud\n", dtcc->rxer);
< 	l += snprint(p+l, READSTR-l, "MissPkt: %ud\n", dtcc->misspkt);
< 	l += snprint(p+l, READSTR-l, "FAE: %ud\n", dtcc->fae);
< 	l += snprint(p+l, READSTR-l, "Tx1Col: %ud\n", dtcc->tx1col);
< 	l += snprint(p+l, READSTR-l, "TxMCol: %ud\n", dtcc->txmcol);
< 	l += snprint(p+l, READSTR-l, "RxOkPh: %llud\n", dtcc->rxokph);
< 	l += snprint(p+l, READSTR-l, "RxOkBrd: %llud\n", dtcc->rxokbrd);
< 	l += snprint(p+l, READSTR-l, "RxOkMu: %ud\n", dtcc->rxokmu);
< 	l += snprint(p+l, READSTR-l, "TxAbt: %ud\n", dtcc->txabt);
< 	l += snprint(p+l, READSTR-l, "TxUndrn: %ud\n", dtcc->txundrn);
---
> 	p = seprint(p, e, "TxOk: %llud\n", dtcc->txok);
> 	p = seprint(p, e, "RxOk: %llud\n", dtcc->rxok);
> 	p = seprint(p, e, "TxEr: %llud\n", dtcc->txer);
> 	p = seprint(p, e, "RxEr: %ud\n", dtcc->rxer);
> 	p = seprint(p, e, "MissPkt: %ud\n", dtcc->misspkt);
> 	p = seprint(p, e, "FAE: %ud\n", dtcc->fae);
> 	p = seprint(p, e, "Tx1Col: %ud\n", dtcc->tx1col);
> 	p = seprint(p, e, "TxMCol: %ud\n", dtcc->txmcol);
> 	p = seprint(p, e, "RxOkPh: %llud\n", dtcc->rxokph);
> 	p = seprint(p, e, "RxOkBrd: %llud\n", dtcc->rxokbrd);
> 	p = seprint(p, e, "RxOkMu: %ud\n", dtcc->rxokmu);
> 	p = seprint(p, e, "TxAbt: %ud\n", dtcc->txabt);
> 	p = seprint(p, e, "TxUndrn: %ud\n", dtcc->txundrn);
542,551c547,557
< 	l += snprint(p+l, READSTR-l, "txdu: %ud\n", ctlr->txdu);
< 	l += snprint(p+l, READSTR-l, "tcpf: %ud\n", ctlr->tcpf);
< 	l += snprint(p+l, READSTR-l, "udpf: %ud\n", ctlr->udpf);
< 	l += snprint(p+l, READSTR-l, "ipf: %ud\n", ctlr->ipf);
< 	l += snprint(p+l, READSTR-l, "fovf: %ud\n", ctlr->fovf);
< 	l += snprint(p+l, READSTR-l, "ierrs: %ud\n", ctlr->ierrs);
< 	l += snprint(p+l, READSTR-l, "rer: %ud\n", ctlr->rer);
< 	l += snprint(p+l, READSTR-l, "rdu: %ud\n", ctlr->rdu);
< 	l += snprint(p+l, READSTR-l, "punlc: %ud\n", ctlr->punlc);
< 	l += snprint(p+l, READSTR-l, "fovw: %ud\n", ctlr->fovw);
---
> 	p = seprint(p, e, "txdu: %ud\n", ctlr->txdu);
> 	p = seprint(p, e, "tcpf: %ud\n", ctlr->tcpf);
> 	p = seprint(p, e, "udpf: %ud\n", ctlr->udpf);
> 	p = seprint(p, e, "ipf: %ud\n", ctlr->ipf);
> 	p = seprint(p, e, "fovf: %ud\n", ctlr->fovf);
> 	p = seprint(p, e, "ierrs: %ud\n", ctlr->ierrs);
> 	p = seprint(p, e, "rer: %ud\n", ctlr->rer);
> 	p = seprint(p, e, "rdu: %ud\n", ctlr->rdu);
> 	p = seprint(p, e, "punlc: %ud\n", ctlr->punlc);
> 	p = seprint(p, e, "fovw: %ud\n", ctlr->fovw);
> 	p = seprint(p, e, "frag: %ud\n", ctlr->frag);
553,555c559,561
< 	l += snprint(p+l, READSTR-l, "tcr: %#8.8ux\n", ctlr->tcr);
< 	l += snprint(p+l, READSTR-l, "rcr: %#8.8ux\n", ctlr->rcr);
< 	l += snprint(p+l, READSTR-l, "multicast: %ud\n", ctlr->mcast);
---
> 	p = seprint(p, e, "tcr: %#8.8ux\n", ctlr->tcr);
> 	p = seprint(p, e, "rcr: %#8.8ux\n", ctlr->rcr);
> 	p = seprint(p, e, "multicast: %ud\n", ctlr->mcast);
558c564
< 		l += snprint(p+l, READSTR, "phy:   ");
---
> 		p = seprint(p, e, "phy:   ");
561c567
< 				l += snprint(p+l, READSTR-l, "\n       ");
---
> 				p = seprint(p, e, "\n       ");
563c569
< 			l += snprint(p+l, READSTR-l, " %4.4ux", r);
---
> 			p = seprint(p, e, " %4.4ux", r);
565c571
< 		snprint(p+l, READSTR-l, "\n");
---
> 		seprint(p, e, "\n");
568c574
< 	n = readstr(offset, a, n, p);
---
> 	n = readstr(offset, a, n, p0);
572c578
< 	free(p);
---
> 	free(p0);
631d636
< 		}
632a638,639
> 		}else
> 			iprint("i8169: rx overrun\n");
655c662
< 	 * MAC Address.
---
> 	 * MAC Address is not settable on some (all?) chips.
659,662d665
< 	r = (edev->ea[3]<<24)|(edev->ea[2]<<16)|(edev->ea[1]<<8)|edev->ea[0];
< 	csr32w(ctlr, Idr0, r);
< 	r = (edev->ea[5]<<8)|edev->ea[4];
< 	csr32w(ctlr, Idr0+4, r);
679c682
< 	for(i = 0; i < ctlr->nrd; i++){
---
> 	for(i = 0; i < ctlr->nrd; i++)
684d686
< 	}
695d696
< 	ctlr->mtps = HOWMANY(Mps, 128);
697c698
< 	cplusc |= /*Rxchksum|*/Mulrw;
---
> 	cplusc |= Rxchksum|Mulrw;
702d702
< 		ctlr->mtps = HOWMANY(Mps, 32);
706c706
< 		cplusc |= (1<<14);			/* magic */
---
> 		cplusc |= 1<<14;			/* magic */
768c768
< 	 * initial early transmit threshold value;
---
> 	 * clear early transmit threshold value;
771a772,776
> 	 *
> 	 * note: the maximum rx size is a filter.  the size of the buffer
> 	 * in the descriptor ring is still honored.  we will toss >Mtu
> 	 * packets because they've been fragmented into mutiple
> 	 * rx buffers.
774c779
< 	csr8w(ctlr, Mtps, ctlr->mtps);
---
> 	csr8w(ctlr, Etx, 0x3f);
779,780c784,785
< 	csr16w(ctlr, Rms, Mps);
< 	r = csr16r(ctlr, Mulint) & 0xF000;
---
> 	csr16w(ctlr, Rms, 16383);		/* was Mps */
> 	r = csr16r(ctlr, Mulint) & 0xF000;	/* no early rx interrupts */
782a788
> 	csr16w(ctlr, Coal, 0);
788,789d793
< 	default:
< 		break;
791d794
< 		csr16w(ctlr, 0xE2, 0);			/* magic */
798d800
< 		csr16w(ctlr, 0xE2, 0);			/* magic */
803,804d804
< 		csr16w(ctlr, Rms, 0x0800);
< 		csr8w(ctlr, Mtps, 0x3F);
928c928
< 		d->control |= Own|Fs|Ls|((BLEN(bp)<<TxflSHIFT) & TxflMASK);
---
> 		d->control |= Own|Fs|Ls|BLEN(bp);
964,966c964,965
< 			ctlr->rb[rdh] = nil;
< 			bp->wp = bp->rp + ((control & RxflMASK)>>RxflSHIFT)-4;
< 			bp->next = nil;
---
> 			bp->wp = bp->rp + (control & RxflMASK)-4;
> //			bp->next = nil;
998a998,1002
> 		}else{
> 			if(!(control&Res))
> 				ctlr->frag++;
> 			/* iprint("i8169: control %#.8ux\n", control); */
> 			freeb(ctlr->rb[rdh]);
1000,1005c1004
< 		else{
< 			/*
< 			 * Error stuff here.
< 			print("control %#8.8ux\n", control);
< 			 */
< 		}
---
> 		ctlr->rb[rdh] = nil;
1169a1169
> 	edev->maxmtu = Mtu;

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].