Bug 226217 - if_qlxgb (QLogic cLOM8214) not working for me when configured via netif
Summary: if_qlxgb (QLogic cLOM8214) not working for me when configured via netif
Status: Closed DUPLICATE of bug 249050
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.1-STABLE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-26 13:35 UTC by pcm
Modified: 2020-09-09 05:23 UTC (History)
5 users (show)

See Also:


Attachments
Fix that mtu not initialized bug (731 bytes, patch)
2020-04-23 01:09 UTC, Christian Vallières
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description pcm 2018-02-26 13:35:25 UTC
Hi,

i got an QLogic cLOM8214 (if_qlxgb) which is working fine when i configure the interface manually:

# uname -psr
FreeBSD 11.1-RELEASE-p4 amd64
# ifconfig ql1 inet 192.168.200.5 netmask 255.255.255.0 up
# ifconfig ql1
ql1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8013b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,TSO4,LINKSTATE>
        ether 8c:dc:d4:59:c1:6c
        hwaddr 8c:dc:d4:59:c1:6c
        inet 192.168.200.5 netmask 0xffffff00 broadcast 192.168.200.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (10Gbase-SR <full-duplex>)
        status: active
# ping 192.168.200.10
PING 192.168.200.10 (192.168.200.10): 56 data bytes
64 bytes from 192.168.200.10: icmp_seq=0 ttl=255 time=0.304 ms
64 bytes from 192.168.200.10: icmp_seq=1 ttl=255 time=0.111 ms

But it is not working when configured via netif:
rc.conf:
ifconfig_ql1="inet 192.168.200.5 netmask 255.255.255.0"

# ifconfig ql1 after boot:
ql1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8013b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,TSO4,LINKSTATE>
        ether 8c:dc:d4:59:c1:6c
        hwaddr 8c:dc:d4:59:c1:6c
        inet 192.168.200.5 netmask 0xffffff00 broadcast 192.168.200.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (10Gbase-SR <full-duplex>)
        status: active

# ping 192.168.200.10
PING 192.168.200.10 (192.168.200.10): 56 data bytes

--- 192.168.200.10 ping statistics ---
2 packets transmitted, 0 packets received, 100.0% packet loss

# dmesg|grep ql1
ql1: <Qlogic ISP 80xx PCI CNA Adapter-Ethernet Function v1.1.36> mem 0xfb800000-0xfb9fffff,0xfb7f0000-0xfb7fffff irq 31 at device 0.1 on pci8
ql1: qla_pci_attach: firmware[4.20.1.1429931003]
ql1: Ethernet address: 8c:dc:d4:59:c1:6c
ql1: qla_hw_send: (nsegs[1, 42, 0x0] > Q8_TX_MAX_SEGMENTS)
ql1: link state changed to UP
ql1: qla_dump_buf8: qla_hw_send: wrong pkt 0x2a dump start
ql1: 0x00000000: ff ff ff ff ff ff 8c dc d4 59 c1 6c 08 06 00 01
ql1: 0x00000010: 08 00 06 04 00 01 8c dc d4 59 c1 6c c0 a8 c8 05
ql1: 0x00000020: 00 00 00 00 00 00 c0 a8 c8 05
ql1: qla_dump_buf8: qla_hw_send: wrong pkt dump end
ql1: qla_hw_send: (nsegs[1, 42, 0x0] > Q8_TX_MAX_SEGMENTS)
ql1: qla_dump_buf8: qla_hw_send: wrong pkt 0x2a dump start
ql1: 0x00000000: ff ff ff ff ff ff 8c dc d4 59 c1 6c 08 06 00 01
ql1: 0x00000010: 08 00 06 04 00 01 8c dc d4 59 c1 6c c0 a8 c8 05
ql1: 0x00000020: 00 00 00 00 00 00 c0 a8 c8 0a
ql1: qla_dump_buf8: qla_hw_send: wrong pkt dump end
ql1: qla_hw_send: (nsegs[1, 42, 0x0] > Q8_TX_MAX_SEGMENTS)
ql1: qla_dump_buf8: qla_hw_send: wrong pkt 0x2a dump start
ql1: 0x00000000: ff ff ff ff ff ff 8c dc d4 59 c1 6c 08 06 00 01
ql1: 0x00000010: 08 00 06 04 00 01 8c dc d4 59 c1 6c c0 a8 c8 05
ql1: 0x00000020: 00 00 00 00 00 00 c0 a8 c8 0a
ql1: qla_dump_buf8: qla_hw_send: wrong pkt dump end
ql1: qla_hw_send: (nsegs[1, 98, 0x0] > Q8_TX_MAX_SEGMENTS)
ql1: qla_dump_buf8: qla_hw_send: wrong pkt 0x62 dump start
ql1: 0x00000000: 90 e2 ba eb 01 68 8c dc d4 59 c1 6c 08 00 45 00
ql1: 0x00000010: 00 54 37 be 00 00 40 01 31 8a c0 a8 c8 05 c0 a8
ql1: 0x00000020: c8 0a 08 00 22 30 22 19 00 01 5a 94 07 ae 00 00
ql1: 0x00000030: 66 70 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15
ql1: 0x00000040: 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25
ql1: 0x00000050: 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35
ql1: 0x00000060: 36 37
ql1: qla_dump_buf8: qla_hw_send: wrong pkt dump end

The driver is loaded via /boot/loader.conf both times.

Cheers,
Daniel Schossig
Comment 1 bchow 2019-06-19 05:17:58 UTC
I am seeing this exact behavior.  If I unplug the interface, manually configure the mtu using ifconfig and replug the device, it works just fine.  However, when it's automatically configured, I am seeing the same error as the original bug report.

Was there ever any resolution or work around?
Comment 2 pcm 2019-07-03 16:00:32 UTC
I ended up using /etc/rc.local to configure the interface. Sadly i do not have access to the server anymore to post you my config because i got a new job.
Comment 3 ednt 2020-01-23 11:19:36 UTC
It happens also to me with OPNsense wich uses (up to now 11.1)
But they swap to 12.1 this month.

And the bufg is also in 12.x

see:
https://forums.freebsd.org/threads/qlxgb-kernel-driver-errors-out-when-configured.68702/

Is there any progress?
Comment 4 Christian Vallières 2020-04-23 01:09:50 UTC
Created attachment 213710 [details]
Fix that mtu not initialized bug

MTU need to be initialized before qla_os:685
ha->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;

Otherwise packet is always flagged as too big in qla_hw.c:1003
if ((mp->m_pkthdr.len > ha->max_frame_size)||(nsegs > Q8_TX_MAX_SEGMENTS)) {

I also moved qla_os:694
ifp->if_capabilities = IFCAP_LINKSTATE;

Before qla_os:687
ether_ifattach(ifp, qla_get_mac_addr(ha));

Like in qlxgbe/ql_os:877 because I had trouble doing ifconfig ql0 up for bridge.
Comment 5 Christian Vallières 2020-04-24 01:13:50 UTC
Comment on attachment 213710 [details]
Fix that mtu not initialized bug

diff --git a/sys/dev/qlxgb/qla_os.c b/sys/dev/qlxgb/qla_os.c
index 0b5daa98891..997f1eccf76 100644
--- a/sys/dev/qlxgb/qla_os.c
+++ b/sys/dev/qlxgb/qla_os.c
@@ -672,6 +672,9 @@ qla_init_ifnet(device_t dev, qla_host_t *ha)
        if_initname(ifp, device_get_name(dev), device_get_unit(dev));

        ifp->if_baudrate = IF_Gbps(10);
+        ifp->if_capabilities = IFCAP_LINKSTATE;
+        ifp->if_mtu = ETHERMTU;
+
        ifp->if_init = qla_init;
        ifp->if_softc = ha;
        ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
@@ -691,7 +694,6 @@ qla_init_ifnet(device_t dev, qla_host_t *ha)
                                IFCAP_JUMBO_MTU;

        ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU;
-       ifp->if_capabilities |= IFCAP_LINKSTATE;

 #if defined(__FreeBSD_version) && (__FreeBSD_version < 900002)
        ifp->if_timer = 0;
Comment 6 Mark Johnston freebsd_committer 2020-09-01 20:14:48 UTC
Sorry it took so long for this to get resolved.  Thanks to Christian it's fixed in head now and will be merged in a few days.

*** This bug has been marked as a duplicate of bug 249050 ***