* Re: [PATCH] net/rds/Kconfig: RDS should depend on IPV6
From: Santosh Shilimkar @ 2018-07-25 22:36 UTC (permalink / raw)
To: Anders Roxell, ka-cheong.poon
Cc: davem, netdev, linux-rdma, rds-devel, linux-kernel
In-Reply-To: <20180725222008.32186-1-anders.roxell@linaro.org>
On 7/25/2018 3:20 PM, Anders Roxell wrote:
> Build error, implicit declaration of function __inet6_ehashfn shows up
> When RDS is enabled but not IPV6.
> net/rds/connection.c: In function ‘rds_conn_bucket’:
> net/rds/connection.c:67:9: error: implicit declaration of function ‘__inet6_ehashfn’; did you mean ‘__inet_ehashfn’? [-Werror=implicit-function-declaration]
> hash = __inet6_ehashfn(lhash, 0, fhash, 0, rds_hash_secret);
> ^~~~~~~~~~~~~~~
> __inet_ehashfn
>
> Current code adds IPV6 as a depends on in config RDS.
>
> Fixes: eee2fa6ab322 ("rds: Changing IP address internal representation to struct in6_addr")
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
> net/rds/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/rds/Kconfig b/net/rds/Kconfig
> index 41f75563b54b..607128f10bcd 100644
> --- a/net/rds/Kconfig
> +++ b/net/rds/Kconfig
> @@ -1,7 +1,7 @@
>
> config RDS
> tristate "The RDS Protocol"
> - depends on INET
> + depends on INET && CONFIG_IPV6
This should build without CONFIG_IPV6 too.
Hi Ka-cheong,
Can you please loot at it ? I know you modified
lookup function to take always in6_addr now, but
probably hashing with '__inet_ehashfn' should
work too for non IPV6 address(s).
Regards,
Santosh
^ permalink raw reply
* Re: [PATCH net-next 0/2] docs: net: Convert netdev-FAQ to RST
From: Tobin C. Harding @ 2018-07-25 22:31 UTC (permalink / raw)
To: Jonathan Corbet; +Cc: David S. Miller, linux-doc, netdev, linux-kernel
In-Reply-To: <20180725081415.373bde37@lwn.net>
On Wed, Jul 25, 2018 at 08:14:15AM -0600, Jonathan Corbet wrote:
> On Wed, 25 Jul 2018 13:28:10 +1000
> "Tobin C. Harding" <me@tobin.cc> wrote:
>
> > Since I've already botched it can I ask for guidance here. The problem
> > is updating the links means making changes that will cause merge
> > conflicts if they go through net-dev tree (since most references are in
> > Documentation/*.rst). But we can't go through docs tree either since
> > that could lead to merge conflicts later as well.
>
> Merge conflicts are a way of life in Documentation/ - everybody messes
> with it. They are usually pretty easy to resolve.
>
> I only see a handful of references to netdev-FAQ.txt in the tree; I would
> suggest just making the change and being done with it. There shouldn't be
> any need to do a more complicated dance than that.
Ok, I'll re-spin with all references fixed.
> And to answer your other question, yes of course it's fine (and expected)
> for this to go through Dave's tree.
And accept abuse for all merge conflicts in person at Plumbers in November :)
Thanks,
Tobin.
^ permalink raw reply
* Re: [PATCH 1/4] docs: bpf: Rename README.rst to index.rst
From: Tobin C. Harding @ 2018-07-25 22:28 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Jonathan Corbet, Alexei Starovoitov, Daniel Borkmann, linux-doc,
netdev, linux-kernel
In-Reply-To: <0141716c-e909-1429-68fe-6da71d4c6677@cogentembedded.com>
On Wed, Jul 25, 2018 at 12:29:10PM +0300, Sergei Shtylyov wrote:
> Hello!
>
> On 7/25/2018 5:29 AM, Tobin C. Harding wrote:
>
> > Recently bpf/ docs were converted to us RST format. 'README.rst' was
>
> s/us/use/?
Thanks for the review Sergei, will fix and re-spin.
> > created but in order to fit in with the Sphinx build system this file
> > should be named 'index.rst'. Rename file, fixes to integrate into Sphinx
> > build system in following patches.
> >
> > docs: Rename Documentation/bpf/README.rst to Documentation/bpf/index.rst
> >
> > Signed-off-by: Tobin C. Harding <me@tobin.cc>
> [...]
>
> MBR, Sergei
What does MBR stand for please (not master boot record I'm guessing)?
Tobin
^ permalink raw reply
* Re: [PATCH bpf-next v2] bpf: add End.DT6 action to bpf_lwt_seg6_action helper
From: Martin KaFai Lau @ 2018-07-25 21:13 UTC (permalink / raw)
To: Mathieu Xhonneux; +Cc: netdev, daniel, alexei.starovoitov
In-Reply-To: <20180725123645.20483-1-m.xhonneux@gmail.com>
On Wed, Jul 25, 2018 at 12:36:45PM +0000, Mathieu Xhonneux wrote:
> The seg6local LWT provides the End.DT6 action, which allows to
> decapsulate an outer IPv6 header containing a Segment Routing Header
> (SRH), full specification is available here:
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__tools.ietf.org_html_draft-2Dfilsfils-2Dspring-2Dsrv6-2Dnetwork-2Dprogramming-2D05&d=DwIBAg&c=5VD0RTtNlTh3ycd41b3MUw&r=VQnoQ7LvghIj0gVEaiQSUw&m=xOQOjR3OUfKkBdRSeFH8x1QqbAb8VVRwECipEqCJyuw&s=L3YiDuRAH4hYSETfa5t_5q2BqaYKJR4d8Vqa8dqqHGo&e=
>
> This patch adds this action now to the seg6local BPF
> interface. Since it is not mandatory that the inner IPv6 header also
> contains a SRH, seg6_bpf_srh_state has been extended with a pointer to
> a possible SRH of the outermost IPv6 header. This helps assessing if the
> validation must be triggered or not, and avoids some calls to
> ipv6_find_hdr.
>
> v2: - changed true/false -> 1/0
hmmm...I thought I was asking to replace 1/0 with true/false. More
below.
> - preempt_enable no longer called in first conditional block
>
> Signed-off-by: Mathieu Xhonneux <m.xhonneux@gmail.com>
> ---
> include/net/seg6_local.h | 4 ++-
> net/core/filter.c | 83 +++++++++++++++++++++++++++++++++---------------
> net/ipv6/seg6_local.c | 48 ++++++++++++++++++----------
> 3 files changed, 91 insertions(+), 44 deletions(-)
>
> diff --git a/include/net/seg6_local.h b/include/net/seg6_local.h
> index 661fd5b4d3e0..08359e2d8b35 100644
> --- a/include/net/seg6_local.h
> +++ b/include/net/seg6_local.h
> @@ -21,10 +21,12 @@
>
> extern int seg6_lookup_nexthop(struct sk_buff *skb, struct in6_addr *nhaddr,
> u32 tbl_id);
> +extern bool seg6_bpf_has_valid_srh(struct sk_buff *skb);
>
> struct seg6_bpf_srh_state {
> - bool valid;
> + struct ipv6_sr_hdr *srh;
> u16 hdrlen;
> + bool valid;
"valid" is a bool, so it is easier to read
if true/false is used in srh_state->valid = true/false;
> };
>
> DECLARE_PER_CPU(struct seg6_bpf_srh_state, seg6_bpf_srh_states);
> diff --git a/net/core/filter.c b/net/core/filter.c
> index 104d560946da..2cdea7d05063 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -4542,14 +4542,13 @@ BPF_CALL_4(bpf_lwt_seg6_store_bytes, struct sk_buff *, skb, u32, offset,
> {
> struct seg6_bpf_srh_state *srh_state =
> this_cpu_ptr(&seg6_bpf_srh_states);
> + struct ipv6_sr_hdr *srh = srh_state->srh;
> void *srh_tlvs, *srh_end, *ptr;
> - struct ipv6_sr_hdr *srh;
> int srhoff = 0;
>
> - if (ipv6_find_hdr(skb, &srhoff, IPPROTO_ROUTING, NULL, NULL) < 0)
> + if (srh == NULL)
> return -EINVAL;
>
> - srh = (struct ipv6_sr_hdr *)(skb->data + srhoff);
> srh_tlvs = (void *)((char *)srh + ((srh->first_segment + 1) << 4));
> srh_end = (void *)((char *)srh + sizeof(*srh) + srh_state->hdrlen);
>
> @@ -4562,6 +4561,9 @@ BPF_CALL_4(bpf_lwt_seg6_store_bytes, struct sk_buff *, skb, u32, offset,
>
> if (unlikely(bpf_try_make_writable(skb, offset + len)))
> return -EFAULT;
> + if (ipv6_find_hdr(skb, &srhoff, IPPROTO_ROUTING, NULL, NULL) < 0)
> + return -EINVAL;
> + srh_state->srh = (struct ipv6_sr_hdr *)(skb->data + srhoff);
>
> memcpy(skb->data + offset, from, len);
> return 0;
> @@ -4577,52 +4579,79 @@ static const struct bpf_func_proto bpf_lwt_seg6_store_bytes_proto = {
> .arg4_type = ARG_CONST_SIZE
> };
>
> -BPF_CALL_4(bpf_lwt_seg6_action, struct sk_buff *, skb,
> - u32, action, void *, param, u32, param_len)
> +static void bpf_update_srh_state(struct sk_buff *skb)
> {
> struct seg6_bpf_srh_state *srh_state =
> this_cpu_ptr(&seg6_bpf_srh_states);
> - struct ipv6_sr_hdr *srh;
> int srhoff = 0;
> - int err;
> -
> - if (ipv6_find_hdr(skb, &srhoff, IPPROTO_ROUTING, NULL, NULL) < 0)
> - return -EINVAL;
> - srh = (struct ipv6_sr_hdr *)(skb->data + srhoff);
> -
> - if (!srh_state->valid) {
> - if (unlikely((srh_state->hdrlen & 7) != 0))
> - return -EBADMSG;
> -
> - srh->hdrlen = (u8)(srh_state->hdrlen >> 3);
> - if (unlikely(!seg6_validate_srh(srh, (srh->hdrlen + 1) << 3)))
> - return -EBADMSG;
>
> + if (ipv6_find_hdr(skb, &srhoff, IPPROTO_ROUTING, NULL, NULL) < 0) {
> + srh_state->srh = NULL;
> + } else {
> + srh_state->srh = (struct ipv6_sr_hdr *)(skb->data + srhoff);
> + srh_state->hdrlen = srh_state->srh->hdrlen << 3;
> srh_state->valid = 1;
e.g. here
> }
> +}
> +
> +BPF_CALL_4(bpf_lwt_seg6_action, struct sk_buff *, skb,
> + u32, action, void *, param, u32, param_len)
> +{
> + struct seg6_bpf_srh_state *srh_state =
> + this_cpu_ptr(&seg6_bpf_srh_states);
> + int hdroff = 0;
> + int err;
>
> switch (action) {
> case SEG6_LOCAL_ACTION_END_X:
> + if (!seg6_bpf_has_valid_srh(skb))
> + return -EBADMSG;
> if (param_len != sizeof(struct in6_addr))
> return -EINVAL;
> return seg6_lookup_nexthop(skb, (struct in6_addr *)param, 0);
> case SEG6_LOCAL_ACTION_END_T:
> + if (!seg6_bpf_has_valid_srh(skb))
> + return -EBADMSG;
> + if (param_len != sizeof(int))
> + return -EINVAL;
> + return seg6_lookup_nexthop(skb, NULL, *(int *)param);
> + case SEG6_LOCAL_ACTION_END_DT6:
> + if (!seg6_bpf_has_valid_srh(skb))
> + return -EBADMSG;
> if (param_len != sizeof(int))
> return -EINVAL;
> +
> + // find inner IPv6 header, pull outer IPv6 header
> + if (ipv6_find_hdr(skb, &hdroff, IPPROTO_IPV6, NULL, NULL) < 0)
> + return -EBADMSG;
> + if (!pskb_pull(skb, hdroff))
> + return -EBADMSG;
> +
> + skb_postpull_rcsum(skb, skb_network_header(skb), hdroff);
> + skb_reset_network_header(skb);
> + skb_reset_transport_header(skb);
> + skb->encapsulation = 0;
> +
> + bpf_compute_data_pointers(skb);
> + bpf_update_srh_state(skb);
> return seg6_lookup_nexthop(skb, NULL, *(int *)param);
> case SEG6_LOCAL_ACTION_END_B6:
> + if (srh_state->srh && !seg6_bpf_has_valid_srh(skb))
> + return -EBADMSG;
> err = bpf_push_seg6_encap(skb, BPF_LWT_ENCAP_SEG6_INLINE,
> param, param_len);
> if (!err)
> - srh_state->hdrlen =
> - ((struct ipv6_sr_hdr *)param)->hdrlen << 3;
> + bpf_update_srh_state(skb);
> +
> return err;
> case SEG6_LOCAL_ACTION_END_B6_ENCAP:
> + if (srh_state->srh && !seg6_bpf_has_valid_srh(skb))
> + return -EBADMSG;
> err = bpf_push_seg6_encap(skb, BPF_LWT_ENCAP_SEG6,
> param, param_len);
> if (!err)
> - srh_state->hdrlen =
> - ((struct ipv6_sr_hdr *)param)->hdrlen << 3;
> + bpf_update_srh_state(skb);
> +
> return err;
> default:
> return -EINVAL;
> @@ -4644,15 +4673,14 @@ BPF_CALL_3(bpf_lwt_seg6_adjust_srh, struct sk_buff *, skb, u32, offset,
> {
> struct seg6_bpf_srh_state *srh_state =
> this_cpu_ptr(&seg6_bpf_srh_states);
> + struct ipv6_sr_hdr *srh = srh_state->srh;
> void *srh_end, *srh_tlvs, *ptr;
> - struct ipv6_sr_hdr *srh;
> struct ipv6hdr *hdr;
> int srhoff = 0;
> int ret;
>
> - if (ipv6_find_hdr(skb, &srhoff, IPPROTO_ROUTING, NULL, NULL) < 0)
> + if (unlikely(srh == NULL))
> return -EINVAL;
> - srh = (struct ipv6_sr_hdr *)(skb->data + srhoff);
>
> srh_tlvs = (void *)((unsigned char *)srh + sizeof(*srh) +
> ((srh->first_segment + 1) << 4));
> @@ -4682,6 +4710,9 @@ BPF_CALL_3(bpf_lwt_seg6_adjust_srh, struct sk_buff *, skb, u32, offset,
> hdr = (struct ipv6hdr *)skb->data;
> hdr->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
>
> + if (ipv6_find_hdr(skb, &srhoff, IPPROTO_ROUTING, NULL, NULL) < 0)
> + return -EINVAL;
> + srh_state->srh = (struct ipv6_sr_hdr *)(skb->data + srhoff);
> srh_state->hdrlen += len;
> srh_state->valid = 0;
> return 0;
> diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
> index e1025b493a18..01f5d6c17f3f 100644
> --- a/net/ipv6/seg6_local.c
> +++ b/net/ipv6/seg6_local.c
> @@ -459,25 +459,49 @@ static int input_action_end_b6_encap(struct sk_buff *skb,
>
> DEFINE_PER_CPU(struct seg6_bpf_srh_state, seg6_bpf_srh_states);
>
> +bool seg6_bpf_has_valid_srh(struct sk_buff *skb)
Same here. returning true/false is better.
> +{
> + struct seg6_bpf_srh_state *srh_state =
> + this_cpu_ptr(&seg6_bpf_srh_states);
> + struct ipv6_sr_hdr *srh = srh_state->srh;
> +
> + if (unlikely(srh == NULL))
> + return 0;
> +
> + if (unlikely(!srh_state->valid)) {
> + if ((srh_state->hdrlen & 7) != 0)
> + return 0;
> +
> + srh->hdrlen = (u8)(srh_state->hdrlen >> 3);
> + if (!seg6_validate_srh(srh, (srh->hdrlen + 1) << 3))
> + return 0;
> +
> + srh_state->valid = 1;
> + }
> +
> + return 1;
> +}
> +
> static int input_action_end_bpf(struct sk_buff *skb,
> struct seg6_local_lwt *slwt)
> {
> struct seg6_bpf_srh_state *srh_state =
> this_cpu_ptr(&seg6_bpf_srh_states);
> - struct seg6_bpf_srh_state local_srh_state;
> struct ipv6_sr_hdr *srh;
> - int srhoff = 0;
> int ret;
>
> srh = get_and_validate_srh(skb);
> - if (!srh)
> - goto drop;
> + if (!srh) {
> + kfree_skb(skb);
> + return -EINVAL;
> + }
> advance_nextseg(srh, &ipv6_hdr(skb)->daddr);
>
> /* preempt_disable is needed to protect the per-CPU buffer srh_state,
> * which is also accessed by the bpf_lwt_seg6_* helpers
> */
> preempt_disable();
> + srh_state->srh = srh;
> srh_state->hdrlen = srh->hdrlen << 3;
> srh_state->valid = 1;
>
> @@ -486,9 +510,6 @@ static int input_action_end_bpf(struct sk_buff *skb,
> ret = bpf_prog_run_save_cb(slwt->bpf.prog, skb);
> rcu_read_unlock();
>
> - local_srh_state = *srh_state;
> - preempt_enable();
> -
> switch (ret) {
> case BPF_OK:
> case BPF_REDIRECT:
> @@ -500,24 +521,17 @@ static int input_action_end_bpf(struct sk_buff *skb,
> goto drop;
> }
>
> - if (unlikely((local_srh_state.hdrlen & 7) != 0))
> - goto drop;
> -
> - if (ipv6_find_hdr(skb, &srhoff, IPPROTO_ROUTING, NULL, NULL) < 0)
> - goto drop;
> - srh = (struct ipv6_sr_hdr *)(skb->data + srhoff);
> - srh->hdrlen = (u8)(local_srh_state.hdrlen >> 3);
> -
> - if (!local_srh_state.valid &&
> - unlikely(!seg6_validate_srh(srh, (srh->hdrlen + 1) << 3)))
> + if (srh_state->srh && !seg6_bpf_has_valid_srh(skb))
> goto drop;
>
> + preempt_enable();
> if (ret != BPF_REDIRECT)
> seg6_lookup_nexthop(skb, NULL, 0);
>
> return dst_input(skb);
>
> drop:
> + preempt_enable();
> kfree_skb(skb);
> return -EINVAL;
> }
> --
> 2.16.1
>
^ permalink raw reply
* Re: [PATCH net-next 1/2] docs: Add rest label the_canonical_path_format
From: Tobin C. Harding @ 2018-07-25 22:26 UTC (permalink / raw)
To: Edward Cree
Cc: David S. Miller, Jonathan Corbet, linux-doc, netdev, linux-kernel
In-Reply-To: <010bd587-6e4d-549e-e613-cb785f614463@solarflare.com>
On Wed, Jul 25, 2018 at 03:36:55PM +0100, Edward Cree wrote:
> On 25/07/18 03:50, Tobin C. Harding wrote:
> > In preparation to convert Documentation/network/netdev-FAQ.rst to
> > restructured text format we would like to be able to reference 'the
> > canonical patch format' section.
> >
> > Add rest label: 'the_canonical_path_format'.
> Here and in the Subject, 'patch' is typoed as 'path'.
Thanks for the review Edward, will fix for next spin.
Tobin
^ permalink raw reply
* [PATCH v2 bpf-next] samples/bpf: xdpsock: order memory on AArch64
From: Brian Brooks @ 2018-07-25 21:08 UTC (permalink / raw)
To: ast, daniel, bjorn.topel, magnus.karlsson
Cc: netdev, linux-kernel, Brian Brooks
Define u_smp_rmb() and u_smp_wmb() to respective barrier instructions.
This ensures the processor will order accesses to queue indices against
accesses to queue ring entries.
Signed-off-by: Brian Brooks <brian.brooks@linaro.org>
---
samples/bpf/xdpsock_user.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/samples/bpf/xdpsock_user.c b/samples/bpf/xdpsock_user.c
index 5904b1543831..1e82f7c617c3 100644
--- a/samples/bpf/xdpsock_user.c
+++ b/samples/bpf/xdpsock_user.c
@@ -145,8 +145,13 @@ static void dump_stats(void);
} while (0)
#define barrier() __asm__ __volatile__("": : :"memory")
+#ifdef __aarch64__
+#define u_smp_rmb() __asm__ __volatile__("dmb ishld": : :"memory")
+#define u_smp_wmb() __asm__ __volatile__("dmb ishst": : :"memory")
+#else
#define u_smp_rmb() barrier()
#define u_smp_wmb() barrier()
+#endif
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
--
2.18.0
^ permalink raw reply related
* Re: [net-next v5 3/3] net/tls: Remove redundant array allocation.
From: Dave Watson @ 2018-07-25 21:01 UTC (permalink / raw)
To: Vakul Garg
Cc: David Miller, netdev@vger.kernel.org, borisp@mellanox.com,
aviadye@mellanox.com, Doron Roberts-Kedes
In-Reply-To: <DB7PR04MB4252EC95B89517727D6F51478B550@DB7PR04MB4252.eurprd04.prod.outlook.com>
On 07/24/18 08:22 AM, Vakul Garg wrote:
> > I don't think this patch is safe as-is. sgin_arr is a stack array of size
> > MAX_SKB_FRAGS (+ overhead), while my read of skb_cow_data is that it
> > walks the whole chain of skbs from skb->next, and can return any number of
> > segments. Therefore we need to heap allocate. I think I copied the IPSEC
> > code here.
> >
> > For perf though, we could use the stack array if skb_cow_data returns <=
> > MAX_SKB_FRAGS.
> >
> > This code is slightly confusing though, since we don't heap allocate in the
> > zerocopy case - what happens is that skb_to_sgvec returns -EMSGSIZE, and
> > we fall back to the non-zerocopy case, and return again to this function,
> > where we then hit the skb_cow_data path and heap allocate.
>
> Thanks for explaining.
> I am missing the point why MAX_SKB_FRAGS sized local array
> sgin has been used in tls_sw_recvmsg(). What is special about MAX_SKB_FRAGS so
> that we used it as a size factor for 'sgin'?
There is nothing special about it, in the zerocopy-fastpath if we
happen to fit in MAX_SKB_FRAGS we avoid any kmalloc whatsoever though.
It could be renamed MAX_SC_FOR_FASTPATH or something.
> Will it be a bad idea to get rid of array 'sgin' on stack and simply kmalloc 'sgin' for
> whatever the number the number of pages returned by iov_iter_npages()?
> We can allocate for sgout too with the same kmalloc().
>
> (Using a local array based 'sgin' is coming in the way to achieve sending multiple async
> record decryption requests to the accelerator without waiting for previous one to complete.)
Yes we could do this, and yes we would need to heap allocate if you
want to support multiple outstanding decryption requests. I think
async crypto prevents any sort of zerocopy-fastpath, however.
^ permalink raw reply
* Re: [PATCH V2 bpf] xdp: add NULL pointer check in __xdp_return()
From: Martin KaFai Lau @ 2018-07-25 20:50 UTC (permalink / raw)
To: Taehee Yoo; +Cc: daniel, ast, bjorn.topel, brouer, netdev
In-Reply-To: <20180725150950.23298-1-ap420073@gmail.com>
On Thu, Jul 26, 2018 at 12:09:50AM +0900, Taehee Yoo wrote:
> rhashtable_lookup() can return NULL. so that NULL pointer
> check routine should be added.
>
> Fixes: 02b55e5657c3 ("xdp: add MEM_TYPE_ZERO_COPY")
> Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
> ---
> V2 : add WARN_ON_ONCE when xa is NULL.
>
> net/core/xdp.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/net/core/xdp.c b/net/core/xdp.c
> index 9d1f220..786fdbe 100644
> --- a/net/core/xdp.c
> +++ b/net/core/xdp.c
> @@ -345,7 +345,10 @@ static void __xdp_return(void *data, struct xdp_mem_info *mem, bool napi_direct,
> rcu_read_lock();
> /* mem->id is valid, checked in xdp_rxq_info_reg_mem_model() */
> xa = rhashtable_lookup(mem_id_ht, &mem->id, mem_id_rht_params);
> - xa->zc_alloc->free(xa->zc_alloc, handle);
> + if (!xa)
> + WARN_ON_ONCE(1);
> + else
> + xa->zc_alloc->free(xa->zc_alloc, handle);
> rcu_read_unlock();
> default:
> /* Not possible, checked in xdp_rxq_info_reg_mem_model() */
> --
> 2.9.3
>
^ permalink raw reply
* [PATCH ipsec-next] xfrm: Return detailed errors from xfrmi_newlink
From: Benedict Wong @ 2018-07-25 20:45 UTC (permalink / raw)
To: netdev; +Cc: nharold, benedictwong, lorenzo
Currently all failure modes of xfrm interface creation return EEXIST.
This change improves the granularity of errnos provided by also
returning ENODEV or EINVAL if failures happen in looking up the
underlying interface, or a required parameter is not provided.
This change has been tested against the Android Kernel Networking Tests,
with additional xfrmi_newlink tests here:
https://android-review.googlesource.com/c/kernel/tests/+/715755
Signed-off-by: Benedict Wong <benedictwong@google.com>
---
net/xfrm/xfrm_interface.c | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c
index ccfe18d67e98..481d7307ab51 100644
--- a/net/xfrm/xfrm_interface.c
+++ b/net/xfrm/xfrm_interface.c
@@ -149,14 +149,18 @@ static struct xfrm_if *xfrmi_create(struct net *net, struct xfrm_if_parms *p)
char name[IFNAMSIZ];
int err;
- if (p->name[0])
+ if (p->name[0]) {
strlcpy(name, p->name, IFNAMSIZ);
- else
+ } else {
+ err = -EINVAL;
goto failed;
+ }
dev = alloc_netdev(sizeof(*xi), name, NET_NAME_UNKNOWN, xfrmi_dev_setup);
- if (!dev)
+ if (!dev) {
+ err = -EAGAIN;
goto failed;
+ }
dev_net_set(dev, net);
@@ -165,8 +169,10 @@ static struct xfrm_if *xfrmi_create(struct net *net, struct xfrm_if_parms *p)
xi->net = net;
xi->dev = dev;
xi->phydev = dev_get_by_index(net, p->link);
- if (!xi->phydev)
+ if (!xi->phydev) {
+ err = -ENODEV;
goto failed_free;
+ }
err = xfrmi_create2(dev);
if (err < 0)
@@ -179,7 +185,7 @@ static struct xfrm_if *xfrmi_create(struct net *net, struct xfrm_if_parms *p)
failed_free:
free_netdev(dev);
failed:
- return NULL;
+ return ERR_PTR(err);
}
static struct xfrm_if *xfrmi_locate(struct net *net, struct xfrm_if_parms *p,
@@ -194,13 +200,13 @@ static struct xfrm_if *xfrmi_locate(struct net *net, struct xfrm_if_parms *p,
xip = &xi->next) {
if (xi->p.if_id == p->if_id) {
if (create)
- return NULL;
+ return ERR_PTR(-EEXIST);
return xi;
}
}
if (!create)
- return NULL;
+ return ERR_PTR(-ENODEV);
return xfrmi_create(net, p);
}
@@ -682,8 +688,9 @@ static int xfrmi_newlink(struct net *src_net, struct net_device *dev,
nla_strlcpy(p->name, tb[IFLA_IFNAME], IFNAMSIZ);
- if (!xfrmi_locate(net, p, 1))
- return -EEXIST;
+ xi = xfrmi_locate(net, p, 1);
+ if (IS_ERR(xi))
+ return PTR_ERR(xi);
return 0;
}
@@ -704,11 +711,12 @@ static int xfrmi_changelink(struct net_device *dev, struct nlattr *tb[],
xi = xfrmi_locate(net, &xi->p, 0);
- if (xi) {
+ if (IS_ERR_OR_NULL(xi)) {
+ xi = netdev_priv(dev);
+ } else {
if (xi->dev != dev)
return -EEXIST;
- } else
- xi = netdev_priv(dev);
+ }
return xfrmi_update(xi, &xi->p);
}
--
2.18.0.233.g985f88cf7e-goog
^ permalink raw reply related
* Re: [PATCH] net: ethernet: fs-enet: Use generic CRC32 implementation
From: David Miller @ 2018-07-25 20:42 UTC (permalink / raw)
To: krzk; +Cc: pantelis.antoniou, linuxppc-dev, netdev, linux-kernel, ebiggers3
In-Reply-To: <20180723162020.6221-1-krzk@kernel.org>
From: Krzysztof Kozlowski <krzk@kernel.org>
Date: Mon, 23 Jul 2018 18:20:20 +0200
> Use generic kernel CRC32 implementation because it:
> 1. Should be faster (uses lookup tables),
> 2. Removes duplicated CRC generation code,
> 3. Uses well-proven algorithm instead of coding it one more time.
>
> Suggested-by: Eric Biggers <ebiggers3@gmail.com>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Applied.
^ permalink raw reply
* Re: [PATCH v2 net-next] net: phy: add helper phy_polling_mode
From: David Miller @ 2018-07-25 20:42 UTC (permalink / raw)
To: hkallweit1; +Cc: andrew, f.fainelli, netdev
In-Reply-To: <e27ffb1d-4c9f-60ee-fb18-a19fc8937b62@gmail.com>
From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Mon, 23 Jul 2018 21:40:07 +0200
> Add a helper for checking whether polling is used to detect PHY status
> changes.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH v1 1/4] igb: Remove unnecessary include of <linux/pci-aspm.h>
From: Jeff Kirsher @ 2018-07-25 21:52 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci
Cc: David S. Miller, Kalle Valo, Johannes Berg, Emmanuel Grumbach,
Luca Coelho, ath9k-devel, linuxwifi, intel-wired-lan, netdev,
linux-kernel, linux-wireless
In-Reply-To: <153254834342.92573.16877025672192312745.stgit@bhelgaas-glaptop.roam.corp.google.com>
[-- Attachment #1: Type: text/plain, Size: 477 bytes --]
On Wed, 2018-07-25 at 14:52 -0500, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> The igb driver doesn't need anything provided by pci-aspm.h, so
> remove
> the unnecessary include of it.
>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
I am fine with you picking up this change.
> ---
> drivers/net/ethernet/intel/igb/igb_main.c | 1 -
> 1 file changed, 1 deletion(-)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH net-next] net/tls: Corrected enabling of zero-copy mode
From: David Miller @ 2018-07-25 20:28 UTC (permalink / raw)
To: vakul.garg; +Cc: netdev, borisp, aviadye, davejwatson
In-Reply-To: <20180723153006.24601-1-vakul.garg@nxp.com>
From: Vakul Garg <vakul.garg@nxp.com>
Date: Mon, 23 Jul 2018 21:00:06 +0530
> @@ -787,7 +787,7 @@ int tls_sw_recvmsg(struct sock *sk,
> target = sock_rcvlowat(sk, flags & MSG_WAITALL, len);
> timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT);
> do {
> - bool zc = false;
> + bool zc;
> int chunk = 0;
>
> skb = tls_wait_data(sk, flags, timeo, &err);
...
> @@ -836,6 +835,7 @@ int tls_sw_recvmsg(struct sock *sk,
> if (err < 0)
> goto fallback_to_reg_recv;
>
> + zc = true;
> err = decrypt_skb_update(sk, skb, sgin, &zc);
> for (; pages > 0; pages--)
> put_page(sg_page(&sgin[pages]));
> @@ -845,6 +845,7 @@ int tls_sw_recvmsg(struct sock *sk,
> }
> } else {
> fallback_to_reg_recv:
> + zc = false;
> err = decrypt_skb_update(sk, skb, NULL, &zc);
> if (err < 0) {
> tls_err_abort(sk, EBADMSG);
> --
> 2.13.6
>
This will leave a code path where 'zc' is evaluated but not initialized to
any value.
And that's the path taken when ctx->decrypted is true. The code after
your changes looks like:
bool zc;
...
if (!ctx->decrypted) {
... assignments to 'zc' happen in this code block
ctx->decrypted = true;
}
if (!zc) {
So when ctx->decrypted it true, the if(!zc) condition runs on an
uninitialized value.
I have to say that your TLS changes are becomming quite a time sink
for two reasons.
First, you are making a lot of changes that seem not so needed, and
whose value is purely determined by taste. I'd put the
msg_data_left() multiple evaluation patch into this category.
The rest require deep review and understanding of the complicated
details of the TLS code, and many of them turn out to be incorrect.
As I find more errors in your submissions, I begin to scrutinize your
patches even more. Thus, review of your changes takes even more time.
And it isn't helping that there are not a lot of other developers
helping actively to review your changes.
I would like to just make a small request to you, that you concentrate
on fixing clear bugs and clear issues that need to be resolved.
Thank you.
^ permalink raw reply
* Re: [PATCH net-next v6 0/4] net: vhost: improve performance when enable busyloop
From: David Miller @ 2018-07-25 20:01 UTC (permalink / raw)
To: xiangxia.m.yue; +Cc: jasowang, mst, makita.toshiaki, virtualization, netdev
In-Reply-To: <1532196242-2998-1-git-send-email-xiangxia.m.yue@gmail.com>
From: xiangxia.m.yue@gmail.com
Date: Sat, 21 Jul 2018 11:03:58 -0700
> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> This patches improve the guest receive performance.
> On the handle_tx side, we poll the sock receive queue
> at the same time. handle_rx do that in the same way.
>
> For more performance report, see patch 4.
>
> v5->v6:
> rebase the codes.
It looks like there is still some dangling discussions about this
patch set.
Please repost this series when those discussions have completed.
Thank you.
^ permalink raw reply
* Re: [PATCH net-next 0/6] virtio_net: Add ethtool stat items
From: David Miller @ 2018-07-25 19:59 UTC (permalink / raw)
To: mst; +Cc: toshiaki.makita1, jasowang, makita.toshiaki, netdev,
virtualization
In-Reply-To: <20180725123908-mutt-send-email-mst@kernel.org>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Wed, 25 Jul 2018 12:40:12 +0300
> On Mon, Jul 23, 2018 at 11:36:03PM +0900, Toshiaki Makita wrote:
>> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
>>
>> Add some ethtool stat items useful for performance analysis.
>>
>> Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
>
> Series:
>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
Series applied.
> Patch 1 seems appropriate for stable, even though it's minor.
Ok, I'll put patch #1 also into 'net' and queue it up for -stable.
Thanks.
^ permalink raw reply
* Re: [Intel-wired-lan] [PATCH v1 1/4] igb: Remove unnecessary include of <linux/pci-aspm.h>
From: Alexander Duyck @ 2018-07-25 21:12 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linux-pci, Emmanuel Grumbach, Johannes Berg, linuxwifi, Netdev,
linux-wireless, ath9k-devel, LKML, Luca Coelho, intel-wired-lan,
David S. Miller, Kalle Valo
In-Reply-To: <153254834342.92573.16877025672192312745.stgit@bhelgaas-glaptop.roam.corp.google.com>
On Wed, Jul 25, 2018 at 12:52 PM, Bjorn Helgaas <helgaas@kernel.org> wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> The igb driver doesn't need anything provided by pci-aspm.h, so remove
> the unnecessary include of it.
>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Looks good to me.
Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
> ---
> drivers/net/ethernet/intel/igb/igb_main.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index f707709969ac..c77fda05f683 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -22,7 +22,6 @@
> #include <linux/if.h>
> #include <linux/if_vlan.h>
> #include <linux/pci.h>
> -#include <linux/pci-aspm.h>
> #include <linux/delay.h>
> #include <linux/interrupt.h>
> #include <linux/ip.h>
>
> _______________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan@osuosl.org
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply
* [PATCH v1 2/4] ath9k: Remove unnecessary include of <linux/pci-aspm.h>
From: Bjorn Helgaas @ 2018-07-25 19:52 UTC (permalink / raw)
To: linux-pci
Cc: Jeff Kirsher, David S. Miller, Kalle Valo, Johannes Berg,
Emmanuel Grumbach, Luca Coelho, ath9k-devel, linuxwifi,
intel-wired-lan, netdev, linux-kernel, linux-wireless
In-Reply-To: <153254813164.92573.10755585465477668768.stgit@bhelgaas-glaptop.roam.corp.google.com>
From: Bjorn Helgaas <bhelgaas@google.com>
The ath9k driver doesn't need anything provided by pci-aspm.h, so remove
the unnecessary include of it.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
drivers/net/wireless/ath/ath9k/pci.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 645f0fbd9179..92b2dd396436 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -18,7 +18,6 @@
#include <linux/nl80211.h>
#include <linux/pci.h>
-#include <linux/pci-aspm.h>
#include <linux/module.h>
#include "ath9k.h"
^ permalink raw reply related
* Re: [PATCH] hinic: Link the logical network device to the pci device in sysfs
From: David Miller @ 2018-07-25 21:01 UTC (permalink / raw)
To: dann.frazier; +Cc: aviad.krawczyk, zhaochen6, netdev, linux-kernel
In-Reply-To: <20180723225540.GA6905@xps13.dannf>
From: dann frazier <dann.frazier@canonical.com>
Date: Mon, 23 Jul 2018 16:55:40 -0600
> Otherwise interfaces get exposed under /sys/devices/virtual, which
> doesn't give udev the context it needs for PCI-based predictable
> interface names.
>
> Signed-off-by: dann frazier <dann.frazier@canonical.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH v1 0/4] PCI: Remove unnecessary includes of <linux/pci-aspm.h>
From: Bjorn Helgaas @ 2018-07-25 20:59 UTC (permalink / raw)
To: Sinan Kaya
Cc: linux-pci, Jeff Kirsher, David S. Miller, Kalle Valo,
Johannes Berg, Emmanuel Grumbach, Luca Coelho, ath9k-devel,
linuxwifi, intel-wired-lan, netdev, linux-kernel, linux-wireless
In-Reply-To: <43748afd-712a-48e5-97a9-0b6046f575b3@kernel.org>
On Wed, Jul 25, 2018 at 01:33:23PM -0700, Sinan Kaya wrote:
> On 7/25/2018 12:52 PM, Bjorn Helgaas wrote:
> > emove includes of <linux/pci-aspm.h> from files that don't need
> > it. I'll apply all these via the PCI tree unless there's objection.
> >
> > ---
> >
> > Bjorn Helgaas (4):
> > igb: Remove unnecessary include of <linux/pci-aspm.h>
> > ath9k: Remove unnecessary include of <linux/pci-aspm.h>
> > iwlwifi: Remove unnecessary include of <linux/pci-aspm.h>
> > PCI: Remove unnecessary include of <linux/pci-aspm.h>
>
> Thanks.
>
> Reviewed-by: Sinan Kaya <okaya@kernel.org>
>
> Is it possible to kill that file altogether? I haven't looked who is
> using outside of pci directory.
Thanks for taking a look!
It's possible we could remove it altogether; there's very little in
it, and in most cases the only reason drivers include it is to disable
certain ASPM link states to work around hardware defects. It might
make sense to just move that interface into <linux/pci.h>.
^ permalink raw reply
* Re: [PATCH v1 3/4] iwlwifi: Remove unnecessary include of <linux/pci-aspm.h>
From: Luciano Coelho @ 2018-07-25 20:59 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci
Cc: Jeff Kirsher, David S. Miller, Kalle Valo, Johannes Berg,
Emmanuel Grumbach, ath9k-devel, linuxwifi, intel-wired-lan,
netdev, linux-kernel, linux-wireless
In-Reply-To: <153254836793.92573.16383045269302376209.stgit@bhelgaas-glaptop.roam.corp.google.com>
On Wed, 2018-07-25 at 14:52 -0500, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> This part of the iwlwifi driver doesn't need anything provided by
> pci-aspm.h, so remove the unnecessary include of it.
>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
Acked-by: Luca Coelho <luciano.coelho@intel.com>
Thanks!
--
Cheers,
Luca.
^ permalink raw reply
* Re: [PATCH] vxge: Remove unnecessary include of <linux/pci_hotplug.h>
From: David Miller @ 2018-07-25 20:52 UTC (permalink / raw)
To: helgaas; +Cc: jdmason, netdev, linux-pci, linux-kernel
In-Reply-To: <153237958637.172194.6734539971240967379.stgit@bhelgaas-glaptop.roam.corp.google.com>
From: Bjorn Helgaas <helgaas@kernel.org>
Date: Mon, 23 Jul 2018 15:59:46 -0500
> From: Bjorn Helgaas <bhelgaas@google.com>
>
> The vxge driver doesn't need anything provided by pci_hotplug.h, so remove
> the unnecessary include of it.
>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Applied to net-next, thanks.
^ permalink raw reply
* Re: [PATCH] samples/bpf: Add BTF build flags to Makefile
From: Martin KaFai Lau @ 2018-07-25 20:45 UTC (permalink / raw)
To: Taeung Song; +Cc: Daniel Borkmann, Alexei Starovoitov, netdev, linux-kernel
In-Reply-To: <20180725203844.ighlqmfw6227rhby@kafai-mbp.dhcp.thefacebook.com>
On Wed, Jul 25, 2018 at 01:38:44PM -0700, Martin KaFai Lau wrote:
> On Thu, Jul 26, 2018 at 01:30:39AM +0900, Taeung Song wrote:
> > To smoothly test BTF supported binary on samples/bpf,
> > let samples/bpf/Makefile probe llc, pahole and
> > llvm-objcopy for BPF support and use them
> > like tools/testing/selftests/bpf/Makefile
> > changed from the commit c0fa1b6c3efc ("bpf: btf:
> > Add BTF tests")
> >
> > Cc: Martin KaFai Lau <kafai@fb.com>
> > Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
> Thanks for the patch. LGTM.
>
> Acked-by: Martin KaFai Lau <kafai@fb.com>
and it should go to bpf-next (Please use the proper tag in the
Subject, thanks!).
>
> > ---
> > samples/bpf/Makefile | 21 ++++++++++++++++++++-
> > 1 file changed, 20 insertions(+), 1 deletion(-)
> >
> > diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> > index 1303af10e54d..e079266360a3 100644
> > --- a/samples/bpf/Makefile
> > +++ b/samples/bpf/Makefile
> > @@ -191,6 +191,8 @@ HOSTLOADLIBES_xdpsock += -pthread
> > # make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang
> > LLC ?= llc
> > CLANG ?= clang
> > +LLVM_OBJCOPY ?= llvm-objcopy
> > +BTF_PAHOLE ?= pahole
> >
> > # Detect that we're cross compiling and use the cross compiler
> > ifdef CROSS_COMPILE
> > @@ -198,6 +200,20 @@ HOSTCC = $(CROSS_COMPILE)gcc
> > CLANG_ARCH_ARGS = -target $(ARCH)
> > endif
> >
> > +BTF_LLC_PROBE := $(shell $(LLC) -march=bpf -mattr=help 2>&1 | grep dwarfris)
> > +BTF_PAHOLE_PROBE := $(shell $(BTF_PAHOLE) --help 2>&1 | grep BTF)
> > +BTF_OBJCOPY_PROBE := $(shell $(LLVM_OBJCOPY) --help 2>&1 | grep -i 'usage.*llvm')
> > +
> > +ifneq ($(BTF_LLC_PROBE),)
> > +ifneq ($(BTF_PAHOLE_PROBE),)
> > +ifneq ($(BTF_OBJCOPY_PROBE),)
> > + EXTRA_CFLAGS += -g
> > + LLC_FLAGS += -mattr=dwarfris
> > + DWARF2BTF = y
> > +endif
> > +endif
> > +endif
> > +
> > # Trick to allow make to be run from this directory
> > all:
> > $(MAKE) -C ../../ $(CURDIR)/ BPF_SAMPLES_PATH=$(CURDIR)
> > @@ -256,4 +272,7 @@ $(obj)/%.o: $(src)/%.c
> > -Wno-gnu-variable-sized-type-not-at-end \
> > -Wno-address-of-packed-member -Wno-tautological-compare \
> > -Wno-unknown-warning-option $(CLANG_ARCH_ARGS) \
> > - -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@
> > + -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf $(LLC_FLAGS) -filetype=obj -o $@
> > +ifeq ($(DWARF2BTF),y)
> > + $(BTF_PAHOLE) -J $@
> > +endif
> > --
> > 2.17.1
> >
^ permalink raw reply
* Re: [PATCH v3] net: ethernet: freescale: Use generic CRC32 implementation
From: David Miller @ 2018-07-25 20:42 UTC (permalink / raw)
To: krzk; +Cc: fugang.duan, netdev, linux-kernel, ebiggers3
In-Reply-To: <20180723161914.6101-1-krzk@kernel.org>
From: Krzysztof Kozlowski <krzk@kernel.org>
Date: Mon, 23 Jul 2018 18:19:14 +0200
> Use generic kernel CRC32 implementation because it:
> 1. Should be faster (uses lookup tables),
> 2. Removes duplicated CRC generation code,
> 3. Uses well-proven algorithm instead of coding it one more time.
>
> Suggested-by: Eric Biggers <ebiggers3@gmail.com>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Applied.
^ permalink raw reply
* Re: [PATCH] samples/bpf: Add BTF build flags to Makefile
From: Martin KaFai Lau @ 2018-07-25 20:38 UTC (permalink / raw)
To: Taeung Song; +Cc: Daniel Borkmann, Alexei Starovoitov, netdev, linux-kernel
In-Reply-To: <20180725163039.2838-1-treeze.taeung@gmail.com>
On Thu, Jul 26, 2018 at 01:30:39AM +0900, Taeung Song wrote:
> To smoothly test BTF supported binary on samples/bpf,
> let samples/bpf/Makefile probe llc, pahole and
> llvm-objcopy for BPF support and use them
> like tools/testing/selftests/bpf/Makefile
> changed from the commit c0fa1b6c3efc ("bpf: btf:
> Add BTF tests")
>
> Cc: Martin KaFai Lau <kafai@fb.com>
> Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Thanks for the patch. LGTM.
Acked-by: Martin KaFai Lau <kafai@fb.com>
> ---
> samples/bpf/Makefile | 21 ++++++++++++++++++++-
> 1 file changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> index 1303af10e54d..e079266360a3 100644
> --- a/samples/bpf/Makefile
> +++ b/samples/bpf/Makefile
> @@ -191,6 +191,8 @@ HOSTLOADLIBES_xdpsock += -pthread
> # make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang
> LLC ?= llc
> CLANG ?= clang
> +LLVM_OBJCOPY ?= llvm-objcopy
> +BTF_PAHOLE ?= pahole
>
> # Detect that we're cross compiling and use the cross compiler
> ifdef CROSS_COMPILE
> @@ -198,6 +200,20 @@ HOSTCC = $(CROSS_COMPILE)gcc
> CLANG_ARCH_ARGS = -target $(ARCH)
> endif
>
> +BTF_LLC_PROBE := $(shell $(LLC) -march=bpf -mattr=help 2>&1 | grep dwarfris)
> +BTF_PAHOLE_PROBE := $(shell $(BTF_PAHOLE) --help 2>&1 | grep BTF)
> +BTF_OBJCOPY_PROBE := $(shell $(LLVM_OBJCOPY) --help 2>&1 | grep -i 'usage.*llvm')
> +
> +ifneq ($(BTF_LLC_PROBE),)
> +ifneq ($(BTF_PAHOLE_PROBE),)
> +ifneq ($(BTF_OBJCOPY_PROBE),)
> + EXTRA_CFLAGS += -g
> + LLC_FLAGS += -mattr=dwarfris
> + DWARF2BTF = y
> +endif
> +endif
> +endif
> +
> # Trick to allow make to be run from this directory
> all:
> $(MAKE) -C ../../ $(CURDIR)/ BPF_SAMPLES_PATH=$(CURDIR)
> @@ -256,4 +272,7 @@ $(obj)/%.o: $(src)/%.c
> -Wno-gnu-variable-sized-type-not-at-end \
> -Wno-address-of-packed-member -Wno-tautological-compare \
> -Wno-unknown-warning-option $(CLANG_ARCH_ARGS) \
> - -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@
> + -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf $(LLC_FLAGS) -filetype=obj -o $@
> +ifeq ($(DWARF2BTF),y)
> + $(BTF_PAHOLE) -J $@
> +endif
> --
> 2.17.1
>
^ permalink raw reply
* Re: [PATCH v1 0/4] PCI: Remove unnecessary includes of <linux/pci-aspm.h>
From: Sinan Kaya @ 2018-07-25 20:33 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci-u79uwXL29TY76Z2rM5mHXA
Cc: Jeff Kirsher, David S. Miller, Kalle Valo, Johannes Berg,
Emmanuel Grumbach, Luca Coelho,
ath9k-devel-A+ZNKFmMK5xy9aJCnZT0Uw,
linuxwifi-ral2JQCrhuEAvxtiuMwx3w,
intel-wired-lan-qjLDD68F18P21nG7glBr7A,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <153254813164.92573.10755585465477668768.stgit-1RhO1Y9PlrlHTL0Zs8A6p5iNqAH0jzoTYJqu5kTmcBRl57MIdRCFDg@public.gmane.org>
On 7/25/2018 12:52 PM, Bjorn Helgaas wrote:
> emove includes of <linux/pci-aspm.h> from files that don't need
> it. I'll apply all these via the PCI tree unless there's objection.
>
> ---
>
> Bjorn Helgaas (4):
> igb: Remove unnecessary include of <linux/pci-aspm.h>
> ath9k: Remove unnecessary include of <linux/pci-aspm.h>
> iwlwifi: Remove unnecessary include of <linux/pci-aspm.h>
> PCI: Remove unnecessary include of <linux/pci-aspm.h>
Thanks.
Reviewed-by: Sinan Kaya <okaya-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Is it possible to kill that file altogether? I haven't looked who is
using outside of pci directory.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox