fix bad statistic. no longer accept flow control from switches. Reference: /n/atom/patch/applied2013/x540nits Date: Wed Dec 18 22:57:43 CET 2013 Signed-off-by: quanstro@quanstro.net --- /sys/src/nix/k10/ether82598.c Wed Dec 18 22:57:14 2013 +++ /sys/src/nix/k10/ether82598.c Wed Dec 18 22:57:14 2013 @@ -229,6 +229,8 @@ 0xcf60, "xon rx", 0x3f68, "xoff tx", 0xcf68, "xoff rx", + 0x4184, "xon rx", /* x540 only */ + 0x41a8, "xoff rx", /* x540 only */ 0x405c, "rx 040", 0x4060, "rx 07f", 0x4064, "rx 100", @@ -256,10 +258,16 @@ }; uchar statmask[Nctlrtype][nelem(stattab)] = { +[i82598][11] = 1, +[i82598][12] = 1, [i82599][7] = 1, [i82599][8] = 1, [i82599][9] = 1, [i82599][10] = 1, +[i82599][11] = 1, +[i82599][12] = 1, +[x540][8] = 1, +[x540][10] = 1, }; /* status */ @@ -695,7 +703,7 @@ } c->rdfree = 0; - c->reg[Fctrl] |= Bam|Rfce|Dpf; + c->reg[Fctrl] |= Bam|Dpf; c->reg[Rxcsum] |= Ipcs; c->reg[Srrctl] = (c->rbsz+1023)/1024; c->reg[Mhadd] = c->rbsz<<16; --- /sys/src/9/pc/ether82598.c Wed Dec 18 22:57:14 2013 +++ /sys/src/9/pc/ether82598.c Wed Dec 18 22:57:14 2013 @@ -229,6 +229,8 @@ 0xcf60, "xon rx", 0x3f68, "xoff tx", 0xcf68, "xoff rx", + 0x4184, "xon rx", /* x540 only */ + 0x41a8, "xoff rx", /* x540 only */ 0x405c, "rx 040", 0x4060, "rx 07f", 0x4064, "rx 100", @@ -256,10 +258,16 @@ }; uchar statmask[Nctlrtype][nelem(stattab)] = { +[i82598][11] = 1, +[i82598][12] = 1, [i82599][7] = 1, [i82599][8] = 1, [i82599][9] = 1, [i82599][10] = 1, +[i82599][11] = 1, +[i82599][12] = 1, +[x540][8] = 1, +[x540][10] = 1, }; /* status */ @@ -695,7 +703,7 @@ } c->rdfree = 0; - c->reg[Fctrl] |= Bam|Rfce|Dpf; + c->reg[Fctrl] |= Bam|Dpf; c->reg[Rxcsum] |= Ipcs; c->reg[Srrctl] = (c->rbsz+1023)/1024; c->reg[Mhadd] = c->rbsz<<16; --- /sys/src/9/pcpae/ether82598.c Wed Dec 18 22:57:14 2013 +++ /sys/src/9/pcpae/ether82598.c Wed Dec 18 22:57:14 2013 @@ -229,6 +229,8 @@ 0xcf60, "xon rx", 0x3f68, "xoff tx", 0xcf68, "xoff rx", + 0x4184, "xon rx", /* x540 only */ + 0x41a8, "xoff rx", /* x540 only */ 0x405c, "rx 040", 0x4060, "rx 07f", 0x4064, "rx 100", @@ -256,10 +258,16 @@ }; uchar statmask[Nctlrtype][nelem(stattab)] = { +[i82598][11] = 1, +[i82598][12] = 1, [i82599][7] = 1, [i82599][8] = 1, [i82599][9] = 1, [i82599][10] = 1, +[i82599][11] = 1, +[i82599][12] = 1, +[x540][8] = 1, +[x540][10] = 1, }; /* status */ @@ -695,7 +703,7 @@ } c->rdfree = 0; - c->reg[Fctrl] |= Bam|Rfce|Dpf; + c->reg[Fctrl] |= Bam|Dpf; c->reg[Rxcsum] |= Ipcs; c->reg[Srrctl] = (c->rbsz+1023)/1024; c->reg[Mhadd] = c->rbsz<<16;