Re: em(4): enable TCP/UDP checksum offload

2013-07-10 Thread Hrvoje Popovski
On 7.11.2012. 12:57, Hrvoje Popovski wrote:
> 
> 82546GB
> pf (with henning's patch) + ipforward and with or without em tcp/udp
> checksum
> - not working
> 
> 
> 82541GI
> pf (with henning's patch) + ipforward + em tcp/udp checksum
> - works like charm
> 


I don't know if it's a good time, but now with new cksum diff and with
enabled TCP/UDP chksum offload on em(4) everything is working fine.

standard user traffic, nat, carp, site-to-site ipsec

with 82541GI stable for 2 weeks
with 82546GB stable for 2 days


OpenBSD 5.3-current (GENERIC.MP) #1: Wed Jun 26 19:05:05 CEST 2013
r...@fw01.net.lab:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 2130444288 (2031MB)
avail mem = 2066063360 (1970MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.3 @ 0xf9920 (87 entries)
bios0: vendor Dell Computer Corporation version "A07" date 04/25/2008
bios0: Dell Computer Corporation PowerEdge 1850
acpi0 at bios0: rev 0
acpi0: sleep states S0 S4 S5
acpi0: tables DSDT FACP APIC SPCR HPET MCFG
acpi0: wakeup devices PCI0(S5) PALO(S5) PBLO(S5) VPR0(S5) PBHI(S5)
VPR1(S5) PICH(S5)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Xeon(TM) CPU 3.40GHz, 3391.96 MHz
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,EST,CNXT-ID,CX16,xTPR,NXE,LONG,PERF
cpu0: 1MB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
cpu0: apic clock running at 199MHz
cpu1 at mainbus0: apid 6 (application processor)
cpu1: Intel(R) Xeon(TM) CPU 3.40GHz, 3391.51 MHz
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,EST,CNXT-ID,CX16,xTPR,NXE,LONG,PERF
cpu1: 1MB 64b/line 8-way L2 cache
cpu1: smt 0, core 0, package 6
ioapic0 at mainbus0: apid 7 pa 0xfec0, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 7
ioapic1 at mainbus0: apid 8 pa 0xfec8, version 20, 24 pins
ioapic1: misconfigured as apic 0, remapped to apid 8
ioapic2 at mainbus0: apid 9 pa 0xfec83000, version 20, 24 pins
ioapic2: misconfigured as apic 0, remapped to apid 9
acpihpet0 at acpi0: 14318179 Hz
acpimcfg0 at acpi0 addr 0xe000, bus 0-255
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (PALO)
acpiprt2 at acpi0: bus 3 (DOBA)
acpiprt3 at acpi0: bus 2 (DOBB)
acpiprt4 at acpi0: bus 4 (PBLO)
acpiprt5 at acpi0: bus 8 (VPR0)
acpiprt6 at acpi0: bus 5 (PBHI)
acpiprt7 at acpi0: bus 6 (PXB1)
acpiprt8 at acpi0: bus 7 (PXB2)
acpiprt9 at acpi0: bus 9 (PICH)
acpicpu0 at acpi0
acpicpu1 at acpi0
ipmi at mainbus0 not configured
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel E7520 Host" rev 0x09
ppb0 at pci0 dev 2 function 0 "Intel E7520 PCIE" rev 0x09
pci1 at ppb0 bus 1
ppb1 at pci1 dev 0 function 0 "Intel 6700PXH PCIE-PCIX" rev 0x09
pci2 at ppb1 bus 2
em0 at pci2 dev 11 function 0 "Intel 82546GB" rev 0x03: apic 7 int 17,
address 00:1b:21:30:99:ba
em1 at pci2 dev 11 function 1 "Intel 82546GB" rev 0x03: apic 7 int 18,
address 00:1b:21:30:99:bb
ppb2 at pci1 dev 0 function 2 "Intel 6700PXH PCIE-PCIX" rev 0x09
pci3 at ppb2 bus 3
mpi0 at pci3 dev 5 function 0 "Symbios Logic 53c1030" rev 0x08: msi
scsibus0 at mpi0: 16 targets, initiator 7
sd0 at scsibus0 targ 0 lun 0:  SCSI3 0/direct
fixed serial.SEAGATE_ST373307LC_3HZ9GTXR
sd0: 70007MB, 512 bytes/sector, 143374650 sectors
safte0 at scsibus0 targ 6 lun 0:  SCSI2
3/processor fixed
mpi0: target 0 Sync at 160MHz width 16bit offset 63 QAS 0 DT 1 IU 1
re0 at pci3 dev 12 function 0 "D-Link DGE-528T" rev 0x10: RTL8169/8110SB
(0x1000), apic 7 int 19, address 00:21:91:f4:6d:3a
rgephy0 at re0 phy 7: RTL8169S/8110S PHY, rev. 3
ppb3 at pci0 dev 4 function 0 "Intel E7520 PCIE" rev 0x09
pci4 at ppb3 bus 4
ppb4 at pci0 dev 5 function 0 "Intel E7520 PCIE" rev 0x09
pci5 at ppb4 bus 5
ppb5 at pci5 dev 0 function 0 "Intel 6700PXH PCIE-PCIX" rev 0x09
pci6 at ppb5 bus 6
em2 at pci6 dev 7 function 0 "Intel 82541GI" rev 0x05: apic 9 int 0,
address 00:11:43:d1:eb:59
ppb6 at pci5 dev 0 function 2 "Intel 6700PXH PCIE-PCIX" rev 0x09
pci7 at ppb6 bus 7
em3 at pci7 dev 8 function 0 "Intel 82541GI" rev 0x05: apic 9 int 1,
address 00:11:43:d1:eb:5a
ppb7 at pci0 dev 6 function 0 "Intel E7520 PCIE" rev 0x09
pci8 at ppb7 bus 8
ppb8 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0xc2
pci9 at ppb8 bus 9
vga1 at pci9 dev 13 function 0 "ATI Radeon VE" rev 0x00
radeondrm0 at vga1: apic 7 int 18
drm0 at radeondrm0
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
pcib0 at pci0 dev 31 function 0 "Intel 82801EB/ER LPC" rev 0x02
pciide0 at pci0 dev 31 function 1 "Intel 82801EB/ER IDE" rev 0x02: DMA,
channel 0 configured to compatibility, channel 1 configured to compatibility
atapiscsi0 at pciide0 channel 0 drive 0
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0:  A

Re: em(4): enable TCP/UDP checksum offload

2012-11-18 Thread Christian Weisgerber
Peter Strömberg  wrote:

> I have a case where it fails.
> rtorrent can't connect to the tracker.
> rtorrent is bound to 192.168.0.2 (em0) and the external iface is em2
> so it's a mixture of having hw-csum and no hw-csum

If this is with Henning's checksum diff backed out again (happened
on Nov 6), then that's expected.

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



Re: em(4): enable TCP/UDP checksum offload

2012-11-18 Thread Peter Strömberg
I have a case where it fails.
rtorrent can't connect to the tracker.
rtorrent is bound to 192.168.0.2 (em0) and the external iface is em2
so it's a mixture of having hw-csum and no hw-csum

em0 at pci2 dev 0 function 0 "Intel PRO/1000 (82576)" rev 0x01: msi,
address 90:e2:ba:0c:95:86
em1 at pci2 dev 0 function 1 "Intel PRO/1000 (82576)" rev 0x01: msi,
address 90:e2:ba:0c:95:87
em2 at pci6 dev 5 function 0 "Intel PRO/1000MT (82541GI)" rev 0x00: apic 4
int 20, address 00:0e:0c:5f:bf:30

em0: flags=8b43
mtu 4088
hwfeatures=10
lladdr 90:e2:ba:0c:95:86
description: lan1 1G/jumbo
priority: 0
media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause)
status: active
inet 192.168.0.2 netmask 0xff00 broadcast 192.168.0.255
inet 192.168.0.1 netmask 0x
em1: flags=8b43
mtu 1500
hwfeatures=10
lladdr 90:e2:ba:0c:95:87
description: lan2 1G/100
priority: 0
media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause)
status: active
em2: flags=8843 mtu 1500
hwfeatures=36
lladdr 00:0e:0c:5f:bf:30
description: wan
priority: 0
groups: egress
media: Ethernet autoselect (100baseTX full-duplex,rxpause,txpause)
status: active
inet 192.168.1.2 netmask 0xff00 broadcast 192.168.1.255

pf.conf:
nic0="em0"
nic1="em1"
ext="em2"
torrent="5881:5889,6881"
table  persist
set block-policy return
set skip on { lo $nic0 $nic1 bridge0 }
block on $ext
pass  in  on $ext inet proto { tcp udp } from any to ($ext) port ssh
pass  in  on $ext inet proto tcp from any to ($ext) port { auth pop3s imaps
}
pass  in  on $ext inet proto tcp from any to ($ext) port { www https }
rdr-to 192.168.0.2
pass  in  on $ext inet proto { tcp udp } from any to ($ext) port { $torrent
} rdr-to 192.168.0.2
pass  in  on $ext inet proto tcp from any to ($ext) port smtp rdr-to
127.0.0.1 port spamd
pass  in  on $ext inet proto tcp from  to ($ext) port smtp
match out on $ext from !($ext) nat-to ($ext:0)



On Wed, Nov 7, 2012 at 9:03 PM, Andreas Bartelt  wrote:

> and these also look good:
>
> > dmesg|grep ^em
> em0 at pci3 dev 0 function 0 "Intel PRO/1000 PT (82572EI)" rev 0x06: apic
> 2 int 17, address X:X:X:X:X:X
>
> > ifconfig em hwfeatures
> em0: flags=8843 mtu 1500
>
> hwfeatures=36
> lladdr X:X:X:X:X:X
> priority: 0
> groups: egress
>
> media: Ethernet autoselect (1000baseT full-duplex)
> status: active
>
> # dmesg|grep ^em
> em0 at pci0 dev 25 function 0 "Intel ICH8 IGP M AMT" rev 0x03: msi,
> address X:X:X:X:X:X
>
> # ifconfig em0 hwfeatures
> em0: flags=8843 mtu 1500
>
> hwfeatures=36
> lladdr X:X:X:X:X:X
> priority: 0
> groups: egress
> media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause)
> status: active
>
> I will keep the patch enabled on these interfaces and report if there
> should be any problems which I didn't notice yet.
>
> Best Regards
> Andreas



Re: em(4): enable TCP/UDP checksum offload

2012-11-07 Thread Andreas Bartelt

and these also look good:

> dmesg|grep ^em
em0 at pci3 dev 0 function 0 "Intel PRO/1000 PT (82572EI)" rev 0x06: 
apic 2 int 17, address X:X:X:X:X:X


> ifconfig em hwfeatures
em0: flags=8843 mtu 1500
hwfeatures=36
lladdr X:X:X:X:X:X
priority: 0
groups: egress
media: Ethernet autoselect (1000baseT full-duplex)
status: active

# dmesg|grep ^em
em0 at pci0 dev 25 function 0 "Intel ICH8 IGP M AMT" rev 0x03: msi, 
address X:X:X:X:X:X


# ifconfig em0 hwfeatures
em0: flags=8843 mtu 1500
hwfeatures=36
lladdr X:X:X:X:X:X
priority: 0
groups: egress
media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause)
status: active

I will keep the patch enabled on these interfaces and report if there 
should be any problems which I didn't notice yet.


Best Regards
Andreas



Re: em(4): enable TCP/UDP checksum offload

2012-11-07 Thread Andreas Bartelt

looks good:

# dmesg |grep ^em
em0 at pci9 dev 0 function 0 "Intel PRO/1000 PT (82571EB)" rev 0x06: 
apic 0 int 8, address X:X:X:X:X:X
em1 at pci9 dev 0 function 1 "Intel PRO/1000 PT (82571EB)" rev 0x06: 
apic 0 int 18, address X:X:X:X:X:X


# ifconfig em hwfeatures
em0: flags=8b43 
mtu 1500

hwfeatures=36
lladdr X:X:X:X:X:X
priority: 0
trunk: trunkdev trunk0
media: Ethernet autoselect (1000baseT full-duplex)
status: active
em1: flags=8b43 
mtu 1500

hwfeatures=36
lladdr X:X:X:X:X:X
priority: 0
trunk: trunkdev trunk0
media: Ethernet autoselect (1000baseT full-duplex)
status: active



Re: em(4): enable TCP/UDP checksum offload

2012-11-07 Thread Christopher Zimmermann
On Sun, 4 Nov 2012 16:06:31 +0100
Christopher Zimmermann  wrote:

> On Sun, 4 Nov 2012 14:46:34 +0100
> Stefan Sperling  wrote:
> 
> > On Sun, Nov 04, 2012 at 01:21:38PM +, Christian Weisgerber wrote:
> > > Christian Weisgerber  wrote:
> > > 
> > > > Like bge(4), we previously couldn't enable TCP/UDP transmit checksum
> > > > offload on em(4).  We can now.
> > > > 
> > > > Works fine here on
> > > >   em0 at pci1 dev 1 function 0 "Intel PRO/1000MT (82540EM)" rev 0x02
> > > > and with VLAN on
> > > >   em0 at pci5 dev 0 function 0 "Intel PRO/1000 MT (82574L)" rev 0x00
> > > 
> > > It does however fail on
> > >   em0 at pci1 dev 0 function 0 "Intel I350" rev 0x01
> > > 
> > > (Watchdog timeouts, interface is unusable.)
> > 
> > This one is working fine:
> > em0 at pci1 dev 0 function 0 "Intel PRO/1000MT (82573L)" rev 0x00
> 
> here too:
> em0 at pci0 dev 25 function 0 "Intel ICH9 IGP M AMT" rev 0x03: msi


and using it actively as NFS (udp) client.



Re: em(4): enable TCP/UDP checksum offload

2012-11-07 Thread Hrvoje Popovski
On 5.11.2012 23:45, Hrvoje Popovski wrote:
> On 5.11.2012. 14:38, Hrvoje Popovski wrote:
>>
>> Hello,
>>
>> it's working here.
> 
> Please ignore "working here" part. It is enabled here.
> Will play with combination of 82546GB and 82541GI interfaces.
> 

82546GB
pf (with henning's patch) + ipforward and with or without em tcp/udp
checksum
- not working


82541GI
pf (with henning's patch) + ipforward + em tcp/udp checksum
- works like charm


with 82546GB and openbsd as host things like ssh, dns (small traffic) works



Re: em(4): enable TCP/UDP checksum offload

2012-11-07 Thread Tomas Bodzar
On Wed, Nov 7, 2012 at 12:32 PM, Tomas Bodzar  wrote:
> Hi,
>
> somewhat strange results here
>
> $ ifconfig em0 hwfeatures
> em0: flags=8843 mtu 1500
> hwfeatures=36
> lladdr XX:XX:XX:XX:XX:XX
> priority: 0
> groups: egress
> media: Ethernet autoselect (100baseTX full-duplex,rxpause,txpause)
> status: active
> inet X.X.X.X netmask 0xff00 broadcast X.X.X.X
> $
>
> "Intel Q45 KT" rev 0x03 at pci0 dev 3 function 3 not configured
> em0 at pci0 dev 25 function 0 "Intel ICH10 D BM LM" rev 0x02: msi,
> address X:X:X:X:X:X
>
> I can ping gateway, I can ping various servers on Internet via IP or
> DNS name, Apache from base running under chroot with HTTP and HTTPS
> and blogsum provided via HTTP. I can ssh login to that machine, I can
> view blogsum from remote machines, but localy on server xombrero or
> lynx is not able to display ANY web page, not even from local Apache.
>
>
>

On VMware Player 5 it seems to be fine including SSH, cvs,
webbrowsing, pf for desktop use, remote X

$ ifconfig em0 hwfeatures
em0: flags=8843 mtu 1500
hwfeatures=36
lladdr X:X:X:X:X:X
priority: 0
groups: egress
media: Ethernet autoselect (1000baseT full-duplex,master)
status: active
inet X.X.X.X netmask 0xff00 broadcast X.X.X.X
$

em0 at pci2 dev 0 function 0 "Intel PRO/1000MT (82545EM)" rev 0x01:
apic 1 int 18, address X:X:X:X:X:X


>
> On Wed, Nov 7, 2012 at 8:50 AM, mxb  wrote:
>> In my case,
>> it is a CARP backup(master will be upgraded soon) rolling ospf on top of gre 
>> on top of ipsec, running npppd,
>> and daily NAT/RDR for about 100 clients.
>>
>> On 6 nov 2012, at 21:31, Stuart Henderson  wrote:
>>
>>> For people who are testing checksum-offload-enabling diffs, it would
>>> help if you could say what sort of things have tested. Things like
>>> fragments/NFS are far more likely to exercise bugs in the hardware
>>> than standard web browsing.



Re: em(4): enable TCP/UDP checksum offload

2012-11-07 Thread Tomas Bodzar
Hi,

somewhat strange results here

$ ifconfig em0 hwfeatures
em0: flags=8843 mtu 1500
hwfeatures=36
lladdr XX:XX:XX:XX:XX:XX
priority: 0
groups: egress
media: Ethernet autoselect (100baseTX full-duplex,rxpause,txpause)
status: active
inet X.X.X.X netmask 0xff00 broadcast X.X.X.X
$

"Intel Q45 KT" rev 0x03 at pci0 dev 3 function 3 not configured
em0 at pci0 dev 25 function 0 "Intel ICH10 D BM LM" rev 0x02: msi,
address X:X:X:X:X:X

I can ping gateway, I can ping various servers on Internet via IP or
DNS name, Apache from base running under chroot with HTTP and HTTPS
and blogsum provided via HTTP. I can ssh login to that machine, I can
view blogsum from remote machines, but localy on server xombrero or
lynx is not able to display ANY web page, not even from local Apache.




On Wed, Nov 7, 2012 at 8:50 AM, mxb  wrote:
> In my case,
> it is a CARP backup(master will be upgraded soon) rolling ospf on top of gre 
> on top of ipsec, running npppd,
> and daily NAT/RDR for about 100 clients.
>
> On 6 nov 2012, at 21:31, Stuart Henderson  wrote:
>
>> For people who are testing checksum-offload-enabling diffs, it would
>> help if you could say what sort of things have tested. Things like
>> fragments/NFS are far more likely to exercise bugs in the hardware
>> than standard web browsing.



Re: em(4): enable TCP/UDP checksum offload

2012-11-06 Thread mxb
In my case,
it is a CARP backup(master will be upgraded soon) rolling ospf on top of gre on 
top of ipsec, running npppd,
and daily NAT/RDR for about 100 clients.

On 6 nov 2012, at 21:31, Stuart Henderson  wrote:

> For people who are testing checksum-offload-enabling diffs, it would
> help if you could say what sort of things have tested. Things like
> fragments/NFS are far more likely to exercise bugs in the hardware
> than standard web browsing.



Re: em(4): enable TCP/UDP checksum offload

2012-11-06 Thread Stuart Henderson
For people who are testing checksum-offload-enabling diffs, it would
help if you could say what sort of things have tested. Things like
fragments/NFS are far more likely to exercise bugs in the hardware
than standard web browsing.



Re: em(4): enable TCP/UDP checksum offload

2012-11-06 Thread mxb
tested on
em0 at pci0 dev 25 function 0 "Intel 82579LM" rev 0x05: msi, address 
00:25:90:27:da:51
em1 at pci6 dev 0 function 0 "Intel PRO/1000 MT (82574L)" rev 0x00: msi, 
address 00:25:90:27:da:50

hwfeatures=36
on both


On 4 nov 2012, at 15:52, Brad Smith  wrote:

> On Sat, Nov 03, 2012 at 09:49:02PM +, Christian Weisgerber wrote:
>> Like bge(4), we previously couldn't enable TCP/UDP transmit checksum
>> offload on em(4).  We can now.
>> 
>> Works fine here on
>>  em0 at pci1 dev 1 function 0 "Intel PRO/1000MT (82540EM)" rev 0x02
>> and with VLAN on
>>  em0 at pci5 dev 0 function 0 "Intel PRO/1000 MT (82574L)" rev 0x00
>> 
>> Does anybody see any value in keeping the #ifdef around?
> 
> Updated diff to disable with hw with known broken driver support.
> 
> 
> Index: if_em.c
> ===
> RCS file: /home/cvs/src/sys/dev/pci/if_em.c,v
> retrieving revision 1.267
> diff -u -p -r1.267 if_em.c
> --- if_em.c   16 Aug 2012 09:31:53 -  1.267
> +++ if_em.c   4 Nov 2012 14:20:30 -
> @@ -211,10 +211,8 @@ int  em_rxfill(struct em_softc *);
> void em_rxeof(struct em_softc *);
> void em_receive_checksum(struct em_softc *, struct em_rx_desc *,
>struct mbuf *);
> -#ifdef EM_CSUM_OFFLOAD
> void em_transmit_checksum_setup(struct em_softc *, struct mbuf *,
>   u_int32_t *, u_int32_t *);
> -#endif
> void em_iff(struct em_softc *);
> #ifdef EM_DEBUG
> void em_print_hw_stats(struct em_softc *);
> @@ -1121,14 +1119,10 @@ em_encap(struct em_softc *sc, struct mbu
>   if (map->dm_nsegs > sc->num_tx_desc_avail - 2)
>   goto fail;
> 
> -#ifdef EM_CSUM_OFFLOAD
>   if (sc->hw.mac_type >= em_82543)
>   em_transmit_checksum_setup(sc, m_head, &txd_upper, &txd_lower);
>   else
>   txd_upper = txd_lower = 0;
> -#else
> - txd_upper = txd_lower = 0;
> -#endif
> 
>   i = sc->next_avail_tx_desc;
>   if (sc->pcix_82544)
> @@ -1853,10 +1847,9 @@ em_setup_interface(struct em_softc *sc)
>   ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
> #endif
> 
> -#ifdef EM_CSUM_OFFLOAD
> - if (sc->hw.mac_type >= em_82543)
> - ifp->if_capabilities |= IFCAP_CSUM_TCPv4|IFCAP_CSUM_UDPv4;
> -#endif
> + if (sc->hw.mac_type >= em_82543 && sc->hw.mac_type != em_82575 &&
> + sc->hw.mac_type != em_82580 && sc->hw.mac_type != em_i350)
> + ifp->if_capabilities |= IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4;
> 
>   /* 
>* Specify the media types supported by this adapter and register
> @@ -2275,7 +2268,6 @@ em_free_transmit_structures(struct em_so
>   sc->txtag = NULL;
> }
> 
> -#ifdef EM_CSUM_OFFLOAD
> /*
>  *
>  *  The offload context needs to be set when we transfer the first
> @@ -2356,7 +2348,6 @@ em_transmit_checksum_setup(struct em_sof
>   sc->num_tx_desc_avail--;
>   sc->next_avail_tx_desc = curr_txd;
> }
> -#endif /* EM_CSUM_OFFLOAD */
> 
> /**
>  *
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.



Re: em(4): enable TCP/UDP checksum offload

2012-11-05 Thread Hrvoje Popovski
On 5.11.2012. 14:38, Hrvoje Popovski wrote:
> 
> Hello,
> 
> it's working here.

Please ignore "working here" part. It is enabled here.
Will play with combination of 82546GB and 82541GI interfaces.



Re: em(4): enable TCP/UDP checksum offload

2012-11-05 Thread Hrvoje Popovski
On 4.11.2012. 15:52, Brad Smith wrote:
> On Sat, Nov 03, 2012 at 09:49:02PM +, Christian Weisgerber wrote:
>> Like bge(4), we previously couldn't enable TCP/UDP transmit checksum
>> offload on em(4).  We can now.
>>
>> Works fine here on
>>   em0 at pci1 dev 1 function 0 "Intel PRO/1000MT (82540EM)" rev 0x02
>> and with VLAN on
>>   em0 at pci5 dev 0 function 0 "Intel PRO/1000 MT (82574L)" rev 0x00
>>
>> Does anybody see any value in keeping the #ifdef around?
> 
> Updated diff to disable with hw with known broken driver support.
> 
> 

Hello,

it's working here.


# ifconfig em0 hwfeatures
em0:
flags=28b43
mtu 1500
hwfeatures=36
lladdr 00:1b:21:30:99:ba
description: OUT_INT
priority: 0
groups: egress
media: Ethernet autoselect (1000baseT full-duplex,rxpause)
status: active
inet 193.198.155.10 netmask 0xfff0 broadcast 193.198.155.15


# ifconfig em1 hwfeatures
em1:
flags=28b43
mtu 1500
hwfeatures=36
lladdr 00:1b:21:30:99:bb
description: VLANS
priority: 0
media: Ethernet autoselect (1000baseT full-duplex,rxpause)
status: active


# ifconfig em2 hwfeatures
em2: flags=28843 mtu 1500
hwfeatures=36
lladdr 00:11:43:d1:ea:8c
description: OSPF_INT
priority: 0
media: Ethernet autoselect (1000baseT
full-duplex,master,rxpause,txpause)
status: active
inet 10.1.1.1 netmask 0xfffc broadcast 10.1.1.3


# ifconfig em3 hwfeatures
em3: flags=28843 mtu 1500
hwfeatures=36
lladdr 00:11:43:d1:ea:8d
description: PFSYNC_INT
priority: 0
media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause)
status: active
inet 10.244.244.1 netmask 0xfffc broadcast 10.244.244.3


# ifconfig vlan600 hwfeatures
vlan600:
flags=28943 mtu 1500
hwfeatures=6
lladdr 00:1b:21:30:99:bb
description: INT_IF
priority: 0
vlan: 600 parent interface: em1
groups: vlan
status: active
inet 193.198.155.34 netmask 0xffe0 broadcast 193.198.155.63


# ifconfig carp0 hwfeatures
carp0: flags=28843 mtu 1500
hwfeatures=6
lladdr 00:00:5e:00:01:01
priority: 0
carp: MASTER carpdev em0 vhid 1 advbase 1 advskew 10 carppeer
193.198.155.11
groups: carp
status: master
inet 193.198.155.12 netmask 0x


# ifconfig carp1 hwfeatures
carp1: flags=28843 mtu 1500
hwfeatures=6
lladdr 00:00:5e:00:01:02
priority: 0
carp: MASTER carpdev vlan600 vhid 2 advbase 1 advskew 10
carppeer 193.198.155.35
groups: carp
status: master
inet 193.198.155.33 netmask 0x




OpenBSD 5.2-current (GENERIC.MP) #1: Mon Nov  5 14:29:48 CET 2012
r...@bcbnfw01.srce.hr:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 3219914752 (3070MB)
avail mem = 3111780352 (2967MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.3 @ 0xf9920 (87 entries)
bios0: vendor Dell Computer Corporation version "A07" date 04/25/2008
bios0: Dell Computer Corporation PowerEdge 1850
acpi0 at bios0: rev 0
acpi0: sleep states S0 S4 S5
acpi0: tables DSDT FACP APIC SPCR HPET MCFG
acpi0: wakeup devices PCI0(S5) PALO(S5) PBLO(S5) VPR0(S5) PBHI(S5)
VPR1(S5) PICH(S5)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Xeon(TM) CPU 3.40GHz, 3391.96 MHz
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,EST,CNXT-ID,CX16,xTPR,NXE,LONG
cpu0: 1MB 64b/line 8-way L2 cache
cpu0: apic clock running at 199MHz
cpu1 at mainbus0: apid 6 (application processor)
cpu1: Intel(R) Xeon(TM) CPU 3.40GHz, 3391.51 MHz
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,EST,CNXT-ID,CX16,xTPR,NXE,LONG
cpu1: 1MB 64b/line 8-way L2 cache
ioapic0 at mainbus0: apid 7 pa 0xfec0, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 7
ioapic1 at mainbus0: apid 8 pa 0xfec8, version 20, 24 pins
ioapic1: misconfigured as apic 0, remapped to apid 8
ioapic2 at mainbus0: apid 9 pa 0xfec83000, version 20, 24 pins
ioapic2: misconfigured as apic 0, remapped to apid 9
acpihpet0 at acpi0: 14318179 Hz
acpimcfg0 at acpi0 addr 0xe000, bus 0-255
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (PALO)
acpiprt2 at acpi0: bus 3 (DOBA)
acpiprt3 at acpi0: bus 2 (DOBB)
acpiprt4 at acpi0: bus 4 (PBLO)
acpiprt5 at acpi0: bus 8 (VPR0)
acpiprt6 at acpi0: bus 5 (PBHI)
acpiprt7 at acpi0: bus 6 (PXB1)
acpiprt8 at acpi0: bus 7 (PXB2)
acpiprt9 at acpi0: bus 9 (PICH)
acpicpu0 at acpi0
acpicpu1 at acpi0
ipmi at mainbus0 not configured
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel E7520 Host" rev 0x09
ppb0 at pci0 dev 2 function 0 

Re: em(4): enable TCP/UDP checksum offload

2012-11-04 Thread Christopher Zimmermann
On Sun, 4 Nov 2012 14:46:34 +0100
Stefan Sperling  wrote:

> On Sun, Nov 04, 2012 at 01:21:38PM +, Christian Weisgerber wrote:
> > Christian Weisgerber  wrote:
> > 
> > > Like bge(4), we previously couldn't enable TCP/UDP transmit checksum
> > > offload on em(4).  We can now.
> > > 
> > > Works fine here on
> > >   em0 at pci1 dev 1 function 0 "Intel PRO/1000MT (82540EM)" rev 0x02
> > > and with VLAN on
> > >   em0 at pci5 dev 0 function 0 "Intel PRO/1000 MT (82574L)" rev 0x00
> > 
> > It does however fail on
> >   em0 at pci1 dev 0 function 0 "Intel I350" rev 0x01
> > 
> > (Watchdog timeouts, interface is unusable.)
> 
> This one is working fine:
> em0 at pci1 dev 0 function 0 "Intel PRO/1000MT (82573L)" rev 0x00

here too:
em0 at pci0 dev 25 function 0 "Intel ICH9 IGP M AMT" rev 0x03: msi



Re: em(4): enable TCP/UDP checksum offload

2012-11-04 Thread Brad Smith
On Sat, Nov 03, 2012 at 09:49:02PM +, Christian Weisgerber wrote:
> Like bge(4), we previously couldn't enable TCP/UDP transmit checksum
> offload on em(4).  We can now.
> 
> Works fine here on
>   em0 at pci1 dev 1 function 0 "Intel PRO/1000MT (82540EM)" rev 0x02
> and with VLAN on
>   em0 at pci5 dev 0 function 0 "Intel PRO/1000 MT (82574L)" rev 0x00
> 
> Does anybody see any value in keeping the #ifdef around?

Updated diff to disable with hw with known broken driver support.


Index: if_em.c
===
RCS file: /home/cvs/src/sys/dev/pci/if_em.c,v
retrieving revision 1.267
diff -u -p -r1.267 if_em.c
--- if_em.c 16 Aug 2012 09:31:53 -  1.267
+++ if_em.c 4 Nov 2012 14:20:30 -
@@ -211,10 +211,8 @@ int  em_rxfill(struct em_softc *);
 void em_rxeof(struct em_softc *);
 void em_receive_checksum(struct em_softc *, struct em_rx_desc *,
 struct mbuf *);
-#ifdef EM_CSUM_OFFLOAD
 void em_transmit_checksum_setup(struct em_softc *, struct mbuf *,
u_int32_t *, u_int32_t *);
-#endif
 void em_iff(struct em_softc *);
 #ifdef EM_DEBUG
 void em_print_hw_stats(struct em_softc *);
@@ -1121,14 +1119,10 @@ em_encap(struct em_softc *sc, struct mbu
if (map->dm_nsegs > sc->num_tx_desc_avail - 2)
goto fail;
 
-#ifdef EM_CSUM_OFFLOAD
if (sc->hw.mac_type >= em_82543)
em_transmit_checksum_setup(sc, m_head, &txd_upper, &txd_lower);
else
txd_upper = txd_lower = 0;
-#else
-   txd_upper = txd_lower = 0;
-#endif
 
i = sc->next_avail_tx_desc;
if (sc->pcix_82544)
@@ -1853,10 +1847,9 @@ em_setup_interface(struct em_softc *sc)
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
 #endif
 
-#ifdef EM_CSUM_OFFLOAD
-   if (sc->hw.mac_type >= em_82543)
-   ifp->if_capabilities |= IFCAP_CSUM_TCPv4|IFCAP_CSUM_UDPv4;
-#endif
+   if (sc->hw.mac_type >= em_82543 && sc->hw.mac_type != em_82575 &&
+   sc->hw.mac_type != em_82580 && sc->hw.mac_type != em_i350)
+   ifp->if_capabilities |= IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4;
 
/* 
 * Specify the media types supported by this adapter and register
@@ -2275,7 +2268,6 @@ em_free_transmit_structures(struct em_so
sc->txtag = NULL;
 }
 
-#ifdef EM_CSUM_OFFLOAD
 /*
  *
  *  The offload context needs to be set when we transfer the first
@@ -2356,7 +2348,6 @@ em_transmit_checksum_setup(struct em_sof
sc->num_tx_desc_avail--;
sc->next_avail_tx_desc = curr_txd;
 }
-#endif /* EM_CSUM_OFFLOAD */
 
 /**
  *

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: em(4): enable TCP/UDP checksum offload

2012-11-04 Thread Stefan Sperling
On Sun, Nov 04, 2012 at 01:21:38PM +, Christian Weisgerber wrote:
> Christian Weisgerber  wrote:
> 
> > Like bge(4), we previously couldn't enable TCP/UDP transmit checksum
> > offload on em(4).  We can now.
> > 
> > Works fine here on
> >   em0 at pci1 dev 1 function 0 "Intel PRO/1000MT (82540EM)" rev 0x02
> > and with VLAN on
> >   em0 at pci5 dev 0 function 0 "Intel PRO/1000 MT (82574L)" rev 0x00
> 
> It does however fail on
>   em0 at pci1 dev 0 function 0 "Intel I350" rev 0x01
> 
> (Watchdog timeouts, interface is unusable.)

This one is working fine:
em0 at pci1 dev 0 function 0 "Intel PRO/1000MT (82573L)" rev 0x00



Re: em(4): enable TCP/UDP checksum offload

2012-11-04 Thread Mike Belopuhov
On Sun, Nov 4, 2012 at 2:21 PM, Christian Weisgerber  wrote:
> Christian Weisgerber  wrote:
>
>> Like bge(4), we previously couldn't enable TCP/UDP transmit checksum
>> offload on em(4).  We can now.
>>
>> Works fine here on
>>   em0 at pci1 dev 1 function 0 "Intel PRO/1000MT (82540EM)" rev 0x02
>> and with VLAN on
>>   em0 at pci5 dev 0 function 0 "Intel PRO/1000 MT (82574L)" rev 0x00
>
> It does however fail on
>   em0 at pci1 dev 0 function 0 "Intel I350" rev 0x01
>
> (Watchdog timeouts, interface is unusable.)
>

oh, that's known. you shouldn't enable it on 75, 76, 80, i350 and i2xx
in other words everything that is supported by igb in freebsd.

> --
> Christian "naddy" Weisgerber  na...@mips.inka.de



Re: em(4): enable TCP/UDP checksum offload

2012-11-04 Thread Christian Weisgerber
Christian Weisgerber  wrote:

> Like bge(4), we previously couldn't enable TCP/UDP transmit checksum
> offload on em(4).  We can now.
> 
> Works fine here on
>   em0 at pci1 dev 1 function 0 "Intel PRO/1000MT (82540EM)" rev 0x02
> and with VLAN on
>   em0 at pci5 dev 0 function 0 "Intel PRO/1000 MT (82574L)" rev 0x00

It does however fail on
  em0 at pci1 dev 0 function 0 "Intel I350" rev 0x01

(Watchdog timeouts, interface is unusable.)

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



em(4): enable TCP/UDP checksum offload

2012-11-03 Thread Christian Weisgerber
Like bge(4), we previously couldn't enable TCP/UDP transmit checksum
offload on em(4).  We can now.

Works fine here on
  em0 at pci1 dev 1 function 0 "Intel PRO/1000MT (82540EM)" rev 0x02
and with VLAN on
  em0 at pci5 dev 0 function 0 "Intel PRO/1000 MT (82574L)" rev 0x00

Does anybody see any value in keeping the #ifdef around?

Index: dev/pci/if_em.c
===
RCS file: /cvs/src/sys/dev/pci/if_em.c,v
retrieving revision 1.267
diff -u -p -r1.267 if_em.c
--- dev/pci/if_em.c 16 Aug 2012 09:31:53 -  1.267
+++ dev/pci/if_em.c 3 Nov 2012 01:53:32 -
@@ -211,10 +211,8 @@ int  em_rxfill(struct em_softc *);
 void em_rxeof(struct em_softc *);
 void em_receive_checksum(struct em_softc *, struct em_rx_desc *,
 struct mbuf *);
-#ifdef EM_CSUM_OFFLOAD
 void em_transmit_checksum_setup(struct em_softc *, struct mbuf *,
u_int32_t *, u_int32_t *);
-#endif
 void em_iff(struct em_softc *);
 #ifdef EM_DEBUG
 void em_print_hw_stats(struct em_softc *);
@@ -1121,14 +1119,10 @@ em_encap(struct em_softc *sc, struct mbu
if (map->dm_nsegs > sc->num_tx_desc_avail - 2)
goto fail;
 
-#ifdef EM_CSUM_OFFLOAD
if (sc->hw.mac_type >= em_82543)
em_transmit_checksum_setup(sc, m_head, &txd_upper, &txd_lower);
else
txd_upper = txd_lower = 0;
-#else
-   txd_upper = txd_lower = 0;
-#endif
 
i = sc->next_avail_tx_desc;
if (sc->pcix_82544)
@@ -1853,10 +1847,8 @@ em_setup_interface(struct em_softc *sc)
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
 #endif
 
-#ifdef EM_CSUM_OFFLOAD
if (sc->hw.mac_type >= em_82543)
ifp->if_capabilities |= IFCAP_CSUM_TCPv4|IFCAP_CSUM_UDPv4;
-#endif
 
/* 
 * Specify the media types supported by this adapter and register
@@ -2275,7 +2267,6 @@ em_free_transmit_structures(struct em_so
sc->txtag = NULL;
 }
 
-#ifdef EM_CSUM_OFFLOAD
 /*
  *
  *  The offload context needs to be set when we transfer the first
@@ -2356,7 +2347,6 @@ em_transmit_checksum_setup(struct em_sof
sc->num_tx_desc_avail--;
sc->next_avail_tx_desc = curr_txd;
 }
-#endif /* EM_CSUM_OFFLOAD */
 
 /**
  *
-- 
Christian "naddy" Weisgerber  na...@mips.inka.de