linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: David Miller <davem@davemloft.net>, Networking <netdev@vger.kernel.org>
Cc: Linux-Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Okash Khawaja <osk@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Martin KaFai Lau <kafai@fb.com>
Subject: linux-next: manual merge of the net-next tree with the bpf tree
Date: Thu, 26 Jul 2018 11:19:16 +1000	[thread overview]
Message-ID: <20180726111916.47a47dbf@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 3345 bytes --]

Hi all,

Today's linux-next merge of the net-next tree got conflicts in:

  tools/lib/bpf/btf.c
  tools/lib/bpf/btf.h

between commits:

  5b891af7fca1 ("bpf: Replace [u]int32_t and [u]int64_t in libbpf")
  38d5d3b3d5db ("bpf: Introduce BPF_ANNOTATE_KV_PAIR")

from the bpf tree and commit:

  92b57121ca79 ("bpf: btf: export btf types and name by offset from lib")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc tools/lib/bpf/btf.c
index 2d270c560df3,03161be094b4..000000000000
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@@ -269,9 -259,29 +266,29 @@@ __s64 btf__resolve_size(const struct bt
  	return nelems * size;
  }
  
+ int btf__resolve_type(const struct btf *btf, __u32 type_id)
+ {
+ 	const struct btf_type *t;
+ 	int depth = 0;
+ 
+ 	t = btf__type_by_id(btf, type_id);
+ 	while (depth < MAX_RESOLVE_DEPTH &&
+ 	       !btf_type_is_void_or_null(t) &&
+ 	       IS_MODIFIER(BTF_INFO_KIND(t->info))) {
+ 		type_id = t->type;
+ 		t = btf__type_by_id(btf, type_id);
+ 		depth++;
+ 	}
+ 
+ 	if (depth == MAX_RESOLVE_DEPTH || btf_type_is_void_or_null(t))
+ 		return -EINVAL;
+ 
+ 	return type_id;
+ }
+ 
 -int32_t btf__find_by_name(const struct btf *btf, const char *type_name)
 +__s32 btf__find_by_name(const struct btf *btf, const char *type_name)
  {
 -	uint32_t i;
 +	__u32 i;
  
  	if (!strcmp(type_name, "void"))
  		return 0;
@@@ -368,3 -379,20 +385,11 @@@ int btf__fd(const struct btf *btf
  {
  	return btf->fd;
  }
+ 
+ const char *btf__name_by_offset(const struct btf *btf, __u32 offset)
+ {
+ 	if (offset < btf->hdr->str_len)
+ 		return &btf->strings[offset];
+ 	else
+ 		return NULL;
+ }
 -
 -const struct btf_type *btf__type_by_id(const struct btf *btf,
 -				       __u32 type_id)
 -{
 -	if (type_id > btf->nr_types)
 -		return NULL;
 -
 -	return btf->types[type_id];
 -}
diff --cc tools/lib/bpf/btf.h
index e2a09a155f84,24f361d99a5e..000000000000
--- a/tools/lib/bpf/btf.h
+++ b/tools/lib/bpf/btf.h
@@@ -15,10 -14,12 +15,12 @@@ typedef int (*btf_print_fn_t)(const cha
  	__attribute__((format(printf, 1, 2)));
  
  void btf__free(struct btf *btf);
 -struct btf *btf__new(uint8_t *data, uint32_t size, btf_print_fn_t err_log);
 -int32_t btf__find_by_name(const struct btf *btf, const char *type_name);
 -int64_t btf__resolve_size(const struct btf *btf, uint32_t type_id);
 +struct btf *btf__new(__u8 *data, __u32 size, btf_print_fn_t err_log);
 +__s32 btf__find_by_name(const struct btf *btf, const char *type_name);
- const struct btf_type *btf__type_by_id(const struct btf *btf, __u32 id);
 +__s64 btf__resolve_size(const struct btf *btf, __u32 type_id);
+ int btf__resolve_type(const struct btf *btf, __u32 type_id);
  int btf__fd(const struct btf *btf);
+ const char *btf__name_by_offset(const struct btf *btf, __u32 offset);
+ const struct btf_type *btf__type_by_id(const struct btf *btf, __u32 type_id);
  
  #endif

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2018-07-26  1:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26  1:19 Stephen Rothwell [this message]
2018-07-26 15:32 ` linux-next: manual merge of the net-next tree with the bpf tree Martin KaFai Lau
  -- strict thread matches above, loose matches on Subject: below --
2022-10-04  1:24 Stephen Rothwell
2022-10-04  2:07 ` Jakub Kicinski
2022-10-04 22:45   ` Stephen Rothwell
2022-09-23  0:45 Stephen Rothwell
2021-10-27  0:12 Stephen Rothwell
2021-06-22  1:06 Stephen Rothwell
2021-04-08  3:11 Stephen Rothwell
2021-04-08  3:02 Stephen Rothwell
2021-03-29  1:29 Stephen Rothwell
2021-03-29  8:28 ` Jiri Olsa
2020-07-16  1:59 Stephen Rothwell
2020-05-26  3:12 Stephen Rothwell
2020-05-26  5:45 ` Björn Töpel
2019-06-06  1:34 Stephen Rothwell
2019-02-20  0:37 Stephen Rothwell
2019-02-20  0:41 ` Alexei Starovoitov
2019-02-20  0:45   ` Stanislav Fomichev
2019-02-20  1:03     ` Stephen Rothwell
2019-02-20  0:48   ` Daniel Borkmann
2019-02-20  3:03     ` Stanislav Fomichev
2018-12-14  0:56 Stephen Rothwell
2018-12-03  2:16 Stephen Rothwell
2018-12-03  2:03 Stephen Rothwell
2018-08-01  1:35 Stephen Rothwell
2018-08-01  4:23 ` Yonghong Song
2018-01-09  0:21 Stephen Rothwell
2018-01-09  0:29 ` Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180726111916.47a47dbf@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=kafai@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=osk@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).