All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-networking][PATCH] mctp: Fix build with 5.15+ kernel headers
@ 2021-11-05 20:24 Khem Raj
  2021-11-06  1:20 ` Bruce Ashfield
  0 siblings, 1 reply; 2+ messages in thread
From: Khem Raj @ 2021-11-05 20:24 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj, Bruce Ashfield

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 .../0001-build-Adjust-for-kernel-mctp.h.patch | 84 +++++++++++++++++++
 .../recipes-support/mctp/mctp_git.bb          |  8 +-
 2 files changed, 90 insertions(+), 2 deletions(-)
 create mode 100644 meta-networking/recipes-support/mctp/mctp/0001-build-Adjust-for-kernel-mctp.h.patch

diff --git a/meta-networking/recipes-support/mctp/mctp/0001-build-Adjust-for-kernel-mctp.h.patch b/meta-networking/recipes-support/mctp/mctp/0001-build-Adjust-for-kernel-mctp.h.patch
new file mode 100644
index 0000000000..83bf197703
--- /dev/null
+++ b/meta-networking/recipes-support/mctp/mctp/0001-build-Adjust-for-kernel-mctp.h.patch
@@ -0,0 +1,84 @@
+From 653eccc918ef993186c312694c288b2a5b39248e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 5 Nov 2021 13:14:55 -0700
+Subject: [PATCH] build: Adjust for kernel mctp.h
+
+Starting 5.15 kernel has mctp.h as well and provides some of the
+defintions, therefore move the ones we need to provide in this header
+outside the conditional check so its always provided regardless of
+header coming from kernel or not.
+
+Include linux/if_link.h so it can pre-define IFLA_MCTP_UNSPEC and other
+defines and there is a check for conditionally providing them here but
+kernel does not have such a check, so if linux/if_link.h is included
+after this header then we end up with duplicate defines
+
+linux/if_link.h:1267:2: error: redefinition of enumerator 'IFLA_MCTP_UNSPEC'
+        IFLA_MCTP_UNSPEC,
+        ^
+../git/src/mctp.h:74:2: note: previous definition is here
+        IFLA_MCTP_UNSPEC,
+        ^
+
+Upstream-Status: Submitted [https://github.com/CodeConstruct/mctp/pull/2]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/mctp.h | 21 +++++++++++----------
+ 1 file changed, 11 insertions(+), 10 deletions(-)
+
+diff --git a/src/mctp.h b/src/mctp.h
+index 4f73def..e602168 100644
+--- a/src/mctp.h
++++ b/src/mctp.h
+@@ -19,6 +19,7 @@
+ #if HAVE_LINUX_MCTP_H
+ #include <linux/mctp.h>
+ #endif
++#include <linux/if_link.h>
+ 
+ #ifndef AF_MCTP
+ #define AF_MCTP 45
+@@ -33,10 +34,6 @@
+ 
+ #ifndef MCTP_NET_ANY
+ 
+-#ifndef MAX_ADDR_LEN
+-#define MAX_ADDR_LEN 32
+-#endif
+-
+ typedef uint8_t			mctp_eid_t;
+ 
+ struct mctp_addr {
+@@ -53,6 +50,16 @@ struct sockaddr_mctp {
+ 	uint8_t			__smctp_pad1;
+ };
+ 
++#define MCTP_NET_ANY 0
++#define MCTP_ADDR_ANY 0xff
++#define MCTP_TAG_OWNER 0x08
++
++#endif /* MCTP_NET_ANY */
++
++#ifndef MAX_ADDR_LEN
++#define MAX_ADDR_LEN 32
++#endif
++
+ struct sockaddr_mctp_ext {
+ 	struct sockaddr_mctp	smctp_base;
+ 	int			smctp_ifindex;
+@@ -61,12 +68,6 @@ struct sockaddr_mctp_ext {
+ 	unsigned char		smctp_haddr[MAX_ADDR_LEN];
+ };
+ 
+-#define MCTP_NET_ANY 0
+-#define MCTP_ADDR_ANY 0xff
+-#define MCTP_TAG_OWNER 0x08
+-
+-#endif /* MCTP_NET_ANY */
+-
+ #ifndef IFLA_MCTP_MAX
+ 
+ /* From if_link.h */
+-- 
+2.33.1
+
diff --git a/meta-networking/recipes-support/mctp/mctp_git.bb b/meta-networking/recipes-support/mctp/mctp_git.bb
index ebfa84d893..50d84d204d 100644
--- a/meta-networking/recipes-support/mctp/mctp_git.bb
+++ b/meta-networking/recipes-support/mctp/mctp_git.bb
@@ -5,9 +5,13 @@ LICENSE = "GPLv2"
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=4cc91856b08b094b4f406a29dc61db21"
 
-SRCREV = "a8658290b7914f67146a982671b09f2270ba1654"
+PV = "0.1+git${SRCPV}"
 
-SRC_URI = "git://github.com/CodeConstruct/mctp;branch=main;protocol=https"
+SRCREV = "072bafe725c50329f99cf9d3b2624e8799e8163a"
+
+SRC_URI = "git://github.com/CodeConstruct/mctp;branch=main;protocol=https \
+           file://0001-build-Adjust-for-kernel-mctp.h.patch \
+          "
 
 S = "${WORKDIR}/git"
 
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [meta-networking][PATCH] mctp: Fix build with 5.15+ kernel headers
  2021-11-05 20:24 [meta-networking][PATCH] mctp: Fix build with 5.15+ kernel headers Khem Raj
@ 2021-11-06  1:20 ` Bruce Ashfield
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2021-11-06  1:20 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-devel

On Fri, Nov 5, 2021 at 4:24 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> Cc: Bruce Ashfield <bruce.ashfield@gmail.com>

Looks good to me, and it fixed the build for me as well.

Bruce

> ---
>  .../0001-build-Adjust-for-kernel-mctp.h.patch | 84 +++++++++++++++++++
>  .../recipes-support/mctp/mctp_git.bb          |  8 +-
>  2 files changed, 90 insertions(+), 2 deletions(-)
>  create mode 100644 meta-networking/recipes-support/mctp/mctp/0001-build-Adjust-for-kernel-mctp.h.patch
>
> diff --git a/meta-networking/recipes-support/mctp/mctp/0001-build-Adjust-for-kernel-mctp.h.patch b/meta-networking/recipes-support/mctp/mctp/0001-build-Adjust-for-kernel-mctp.h.patch
> new file mode 100644
> index 0000000000..83bf197703
> --- /dev/null
> +++ b/meta-networking/recipes-support/mctp/mctp/0001-build-Adjust-for-kernel-mctp.h.patch
> @@ -0,0 +1,84 @@
> +From 653eccc918ef993186c312694c288b2a5b39248e Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Fri, 5 Nov 2021 13:14:55 -0700
> +Subject: [PATCH] build: Adjust for kernel mctp.h
> +
> +Starting 5.15 kernel has mctp.h as well and provides some of the
> +defintions, therefore move the ones we need to provide in this header
> +outside the conditional check so its always provided regardless of
> +header coming from kernel or not.
> +
> +Include linux/if_link.h so it can pre-define IFLA_MCTP_UNSPEC and other
> +defines and there is a check for conditionally providing them here but
> +kernel does not have such a check, so if linux/if_link.h is included
> +after this header then we end up with duplicate defines
> +
> +linux/if_link.h:1267:2: error: redefinition of enumerator 'IFLA_MCTP_UNSPEC'
> +        IFLA_MCTP_UNSPEC,
> +        ^
> +../git/src/mctp.h:74:2: note: previous definition is here
> +        IFLA_MCTP_UNSPEC,
> +        ^
> +
> +Upstream-Status: Submitted [https://github.com/CodeConstruct/mctp/pull/2]
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +---
> + src/mctp.h | 21 +++++++++++----------
> + 1 file changed, 11 insertions(+), 10 deletions(-)
> +
> +diff --git a/src/mctp.h b/src/mctp.h
> +index 4f73def..e602168 100644
> +--- a/src/mctp.h
> ++++ b/src/mctp.h
> +@@ -19,6 +19,7 @@
> + #if HAVE_LINUX_MCTP_H
> + #include <linux/mctp.h>
> + #endif
> ++#include <linux/if_link.h>
> +
> + #ifndef AF_MCTP
> + #define AF_MCTP 45
> +@@ -33,10 +34,6 @@
> +
> + #ifndef MCTP_NET_ANY
> +
> +-#ifndef MAX_ADDR_LEN
> +-#define MAX_ADDR_LEN 32
> +-#endif
> +-
> + typedef uint8_t                       mctp_eid_t;
> +
> + struct mctp_addr {
> +@@ -53,6 +50,16 @@ struct sockaddr_mctp {
> +       uint8_t                 __smctp_pad1;
> + };
> +
> ++#define MCTP_NET_ANY 0
> ++#define MCTP_ADDR_ANY 0xff
> ++#define MCTP_TAG_OWNER 0x08
> ++
> ++#endif /* MCTP_NET_ANY */
> ++
> ++#ifndef MAX_ADDR_LEN
> ++#define MAX_ADDR_LEN 32
> ++#endif
> ++
> + struct sockaddr_mctp_ext {
> +       struct sockaddr_mctp    smctp_base;
> +       int                     smctp_ifindex;
> +@@ -61,12 +68,6 @@ struct sockaddr_mctp_ext {
> +       unsigned char           smctp_haddr[MAX_ADDR_LEN];
> + };
> +
> +-#define MCTP_NET_ANY 0
> +-#define MCTP_ADDR_ANY 0xff
> +-#define MCTP_TAG_OWNER 0x08
> +-
> +-#endif /* MCTP_NET_ANY */
> +-
> + #ifndef IFLA_MCTP_MAX
> +
> + /* From if_link.h */
> +--
> +2.33.1
> +
> diff --git a/meta-networking/recipes-support/mctp/mctp_git.bb b/meta-networking/recipes-support/mctp/mctp_git.bb
> index ebfa84d893..50d84d204d 100644
> --- a/meta-networking/recipes-support/mctp/mctp_git.bb
> +++ b/meta-networking/recipes-support/mctp/mctp_git.bb
> @@ -5,9 +5,13 @@ LICENSE = "GPLv2"
>
>  LIC_FILES_CHKSUM = "file://LICENSE;md5=4cc91856b08b094b4f406a29dc61db21"
>
> -SRCREV = "a8658290b7914f67146a982671b09f2270ba1654"
> +PV = "0.1+git${SRCPV}"
>
> -SRC_URI = "git://github.com/CodeConstruct/mctp;branch=main;protocol=https"
> +SRCREV = "072bafe725c50329f99cf9d3b2624e8799e8163a"
> +
> +SRC_URI = "git://github.com/CodeConstruct/mctp;branch=main;protocol=https \
> +           file://0001-build-Adjust-for-kernel-mctp.h.patch \
> +          "
>
>  S = "${WORKDIR}/git"
>
> --
> 2.33.1
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-06  1:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05 20:24 [meta-networking][PATCH] mctp: Fix build with 5.15+ kernel headers Khem Raj
2021-11-06  1:20 ` Bruce Ashfield

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.