Bug 254137 - releng/13.0: virtio if_vtbe fails to compile on armv7 SOCKIT-BERI
Summary: releng/13.0: virtio if_vtbe fails to compile on armv7 SOCKIT-BERI
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: 13.0-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Jessica Clarke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-08 17:36 UTC by Mina Galić
Modified: 2021-06-16 15:50 UTC (History)
1 user (show)

See Also:
markj: mfc-stable13+
markj: mfc-stable12-
markj: mfc-stable11-
markj: exp-run-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mina Galić freebsd_triage 2021-03-08 17:36:19 UTC
i haven't had time to verify STABLE or CURRENT yet, because a single compile takes around 6 hours and poudriere helpfully deletes fails pkgbase builds…

anyway, here's is the compile failure:

```
--- if_vtbe.o ---
In file included from /poudriere/jails/13-release-armv7/usr/src/sys/dev/beri/virtio/network/if_vtbe.c:84:
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:295:7: error: offsetof of incomplete type 'struct udphdr'
        case offsetof(struct udphdr, uh_sum):
             ^        ~~~~~~
/poudriere/jails/13-release-armv7/usr/src/sys/sys/stddef.h:43:31: note: expanded from macro 'offsetof'
#define offsetof(type, field)   __offsetof(type, field)
                                ^          ~~~~
/poudriere/jails/13-release-armv7/usr/src/sys/sys/cdefs.h:472:34: note: expanded from macro '__offsetof'
#define __offsetof(type, field)  __builtin_offsetof(type, field)
                                 ^                  ~~~~
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:295:23: note: forward declaration of 'struct udphdr'
        case offsetof(struct udphdr, uh_sum):
                             ^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:296:7: error: offsetof of incomplete type 'struct tcphdr'
        case offsetof(struct tcphdr, th_sum):
             ^        ~~~~~~
/poudriere/jails/13-release-armv7/usr/src/sys/sys/stddef.h:43:31: note: expanded from macro 'offsetof'
#define offsetof(type, field)   __offsetof(type, field)
                                ^          ~~~~
/poudriere/jails/13-release-armv7/usr/src/sys/sys/cdefs.h:472:34: note: expanded from macro '__offsetof'
#define __offsetof(type, field)  __builtin_offsetof(type, field)
                                 ^                  ~~~~
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:296:23: note: forward declaration of 'struct tcphdr'
        case offsetof(struct tcphdr, th_sum):
                             ^
Building /usr/obj/poudriere/jails/13-release-armv7/usr/src/arm.armv7/sys/SOCKIT-BERI/hints.o
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:342:7: error: use of undeclared identifier 'IPPROTO_TCP'
        case IPPROTO_TCP:
             ^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:343:43: error: invalid application of 'sizeof' to an incomplete type 'struct tcphdr'
                if (__predict_false(m->m_len < offset + sizeof(struct tcphdr)))
                                                        ^     ~~~~~~~~~~~~~~~
/poudriere/jails/13-release-armv7/usr/src/sys/sys/cdefs.h:451:51: note: expanded from macro '__predict_false'
#define __predict_false(exp)    __builtin_expect((exp), 0)
                                ^          ~~~~
/poudriere/jails/13-release-armv7/usr/src/sys/sys/cdefs.h:472:34: note: expanded from macro '__offsetof'
#define __offsetof(type, field)  __builtin_offsetof(type, field)
                                 ^                  ~~~~
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:296:23: note: forward declaration of 'struct tcphdr'
        case offsetof(struct tcphdr, th_sum):
                             ^
Building /usr/obj/poudriere/jails/13-release-armv7/usr/src/arm.armv7/sys/SOCKIT-BERI/hints.o
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:342:7: error: use of undeclared identifier 'IPPROTO_TCP'
        case IPPROTO_TCP:
             ^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:343:43: error: invalid application of 'sizeof' to an incomplete type 'struct tcphdr'
                if (__predict_false(m->m_len < offset + sizeof(struct tcphdr)))
                                                        ^     ~~~~~~~~~~~~~~~
/poudriere/jails/13-release-armv7/usr/src/sys/sys/cdefs.h:451:51: note: expanded from macro '__predict_false'
#define __predict_false(exp)    __builtin_expect((exp), 0)
                                                  ^~~
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:343:57: note: forward declaration of 'struct tcphdr'
                if (__predict_false(m->m_len < offset + sizeof(struct tcphdr)))
                                                                      ^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:348:7: error: use of undeclared identifier 'IPPROTO_UDP'
        case IPPROTO_UDP:
             ^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:349:43: error: invalid application of 'sizeof' to an incomplete type 'struct udphdr'
                if (__predict_false(m->m_len < offset + sizeof(struct udphdr)))
                                                        ^     ~~~~~~~~~~~~~~~
/poudriere/jails/13-release-armv7/usr/src/sys/sys/cdefs.h:451:51: note: expanded from macro '__predict_false'
#define __predict_false(exp)    __builtin_expect((exp), 0)
                                                  ^~~
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:349:57: note: forward declaration of 'struct udphdr'
                if (__predict_false(m->m_len < offset + sizeof(struct udphdr)))
                                                                      ^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:467:22: error: variable has incomplete type 'struct tcphdr'
        struct tcphdr *tcp, tcphdr;
                            ^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:467:9: note: forward declaration of 'struct tcphdr'
        struct tcphdr *tcp, tcphdr;
               ^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:469:42: error: invalid application of 'sizeof' to an incomplete type 'struct tcphdr'
        if (__predict_false(m->m_len < offset + sizeof(struct tcphdr))) {
                                                ^     ~~~~~~~~~~~~~~~
/poudriere/jails/13-release-armv7/usr/src/sys/sys/cdefs.h:451:51: note: expanded from macro '__predict_false'
#define __predict_false(exp)    __builtin_expect((exp), 0)
                                                  ^~~
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:467:9: note: forward declaration of 'struct tcphdr'
        struct tcphdr *tcp, tcphdr;
               ^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:470:25: error: invalid application of 'sizeof' to an incomplete type 'struct tcphdr'
                m_copydata(m, offset, sizeof(struct tcphdr), (caddr_t) &tcphdr);
                                      ^     ~~~~~~~~~~~~~~~
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:467:9: note: forward declaration of 'struct tcphdr'
        struct tcphdr *tcp, tcphdr;
               ^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:475:30: error: incomplete definition of type 'struct tcphdr'
        hdr->hdr_len = offset + (tcp->th_off << 2);
                                 ~~~^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:467:9: note: forward declaration of 'struct tcphdr'
        struct tcphdr *tcp, tcphdr;
               ^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:480:9: error: incomplete definition of type 'struct tcphdr'
        if (tcp->th_flags & TH_CWR) {
            ~~~^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:467:9: note: forward declaration of 'struct tcphdr'
        struct tcphdr *tcp, tcphdr;
               ^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:480:22: error: use of undeclared identifier 'TH_CWR'
        if (tcp->th_flags & TH_CWR) {
                            ^
/poudriere/jails/13-release-armv7/usr/src/sys/dev/virtio/network/virtio_net.h:526:32: error: use of undeclared identifier 'IPPROTO_TCP'
                if (__predict_false(proto != IPPROTO_TCP)) {
                                             ^
13 errors generated.
*** [if_vtbe.o] Error code 1

make[2]: stopped in /usr/obj/poudriere/jails/13-release-armv7/usr/src/arm.armv7/sys/SOCKIT-BERI
Comment 1 commit-hook freebsd_committer freebsd_triage 2021-03-08 20:53:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=f2f8405cf6b50a9d91acc02073abf1062d9d34f4

commit f2f8405cf6b50a9d91acc02073abf1062d9d34f4
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2021-03-08 20:47:29 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2021-03-08 20:48:48 +0000

    if_vtbe: Add missing includes to fix build

    PR:             254137
    Reported by:    Mina GaliÄ <me@igalic.co>
    MFC after:      3 days
    Fixes:          f8bc74e2f4a5 ("tap: add support for virtio-net offloads")

 sys/dev/beri/virtio/network/if_vtbe.c | 4 ++++
 1 file changed, 4 insertions(+)
Comment 2 commit-hook freebsd_committer freebsd_triage 2021-03-08 21:05:16 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e3394851b5da6ec46e655a4f801cd6cac0840445

commit e3394851b5da6ec46e655a4f801cd6cac0840445
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2021-03-08 20:47:29 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2021-03-08 21:04:40 +0000

    if_vtbe: Add missing includes to fix build

    PR:             254137
    Reported by:    Mina GaliÄ <me@igalic.co>
    Fixes:          f8bc74e2f4a5 ("tap: add support for virtio-net offloads")

    (cherry picked from commit f2f8405cf6b50a9d91acc02073abf1062d9d34f4)

 sys/dev/beri/virtio/network/if_vtbe.c | 4 ++++
 1 file changed, 4 insertions(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2021-03-08 21:35:20 UTC
A commit in branch releng/13.0 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=a239b47cc966165d6f515c9787834abb7742cc95

commit a239b47cc966165d6f515c9787834abb7742cc95
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2021-03-08 20:47:29 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2021-03-08 21:33:27 +0000

    if_vtbe: Add missing includes to fix build

    PR:             254137
    Reported by:    Mina GaliÄ <me@igalic.co>
    Fixes:          f8bc74e2f4a5 ("tap: add support for virtio-net offloads")
    Approved by:    re (gjb)

    (cherry picked from commit f2f8405cf6b50a9d91acc02073abf1062d9d34f4)
    (cherry picked from commit e3394851b5da6ec46e655a4f801cd6cac0840445)

 sys/dev/beri/virtio/network/if_vtbe.c | 4 ++++
 1 file changed, 4 insertions(+)