netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <ast@plumgrid.com>
To: David Laight <David.Laight@aculab.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net] net: filter: fix typo in sparc BPF JIT
Date: Fri, 6 Jun 2014 08:27:16 -0700	[thread overview]
Message-ID: <CAMEtUux-zmM0Ry4kRiL5D+AvQnby0Qn-mCxJSEyyvoEyUBE7Zg@mail.gmail.com> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D172584FF@AcuExch.aculab.com>

On Fri, Jun 6, 2014 at 1:36 AM, David Laight <David.Laight@aculab.com> wrote:
> From: Alexei Starovoitov
>> fix typo in sparc codegen for SKF_AD_IFINDEX and SKF_AD_HATYPE
>> classic BPF extensions
> ...
>> --- a/arch/sparc/net/bpf_jit_comp.c
>> +++ b/arch/sparc/net/bpf_jit_comp.c
>> @@ -83,9 +83,9 @@ static void bpf_flush_icache(void *start_, void *end_)
>>  #define BNE          (F2(0, 2) | CONDNE)
>>
>>  #ifdef CONFIG_SPARC64
>> -#define BNE_PTR              (F2(0, 1) | CONDNE | (2 << 20))
>> +#define BE_PTR               (F2(0, 1) | CONDE | (2 << 20))
>>  #else
>> -#define BNE_PTR              BNE
>> +#define BE_PTR               BNE
>>  #endif
>
> That doesn't look right.
> AFAICT you've had to invert the branch in the code (below) so need
> the alternate define - I presume this is the only place they are used.
> But the second is only partially inverted.

Ohh. yes. sorry. It's a copy paste error from net-next into net :((
I fixed it carefully in net-next first, then tried to git am, had to
do it manually, built/ran sparc64 only.

> I presume you only tested sparc64?

yes. I don't have it setup yet.

>         David
>
>>  #define SETHI(K, REG)        \
>> @@ -600,7 +600,7 @@ void bpf_jit_compile(struct sk_filter *fp)
>>                       case BPF_S_ANC_IFINDEX:
>>                               emit_skb_loadptr(dev, r_A);
>>                               emit_cmpi(r_A, 0);
>> -                             emit_branch(BNE_PTR, cleanup_addr + 4);
>> +                             emit_branch(BE_PTR, cleanup_addr + 4);
>>                               emit_nop();
>>                               emit_load32(r_A, struct net_device, ifindex, r_A);
>>                               break;
>> @@ -613,7 +613,7 @@ void bpf_jit_compile(struct sk_filter *fp)
>>                       case BPF_S_ANC_HATYPE:
>>                               emit_skb_loadptr(dev, r_A);
>>                               emit_cmpi(r_A, 0);
>> -                             emit_branch(BNE_PTR, cleanup_addr + 4);
>> +                             emit_branch(BE_PTR, cleanup_addr + 4);
>>                               emit_nop();
>>                               emit_load16(r_A, struct net_device, type, r_A);
>>                               break;
>> --
>> 1.7.9.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

  reply	other threads:[~2014-06-06 15:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-06  5:47 [PATCH net] net: filter: fix typo in sparc BPF JIT Alexei Starovoitov
2014-06-06  7:47 ` David Miller
2014-06-06  8:36 ` David Laight
2014-06-06 15:27   ` Alexei Starovoitov [this message]
2014-06-06 14:11 ` Sergei Shtylyov

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=CAMEtUux-zmM0Ry4kRiL5D+AvQnby0Qn-mCxJSEyyvoEyUBE7Zg@mail.gmail.com \
    --to=ast@plumgrid.com \
    --cc=David.Laight@aculab.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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).