On Tue, Jun 26, 2018 at 12:08 AM, Jakub Kicinski
<jakub.kicin...@netronome.com> wrote:
> On Mon, Jun 25, 2018 at 10:50 PM, Song Liu <liu.song....@gmail.com> wrote:
>> On Sun, Jun 24, 2018 at 8:54 PM, Jakub Kicinski
>> <jakub.kicin...@netronome.com> wrote:
>>> From: Jiong Wang <jiong.w...@netronome.com>
>>>
>>> Map read has been supported on NFP, this patch enables optimization for
>>> memcpy from map to packet.
>>>
>>> This patch also fixed one latent bug which will cause copying from
>>> unexpected address once memcpy for map pointer enabled.
>>>
>>> Reported-by: Mary Pham <mary.p...@netronome.com>
>>> Reported-by: David Beckett <david.beck...@netronome.com>
>>> Signed-off-by: Jiong Wang <jiong.w...@netronome.com>
>>> Reviewed-by: Jakub Kicinski <jakub.kicin...@netronome.com>
>>> ---
>>>  drivers/net/ethernet/netronome/nfp/bpf/jit.c | 5 +++--
>>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/netronome/nfp/bpf/jit.c 
>>> b/drivers/net/ethernet/netronome/nfp/bpf/jit.c
>>> index 8a92088df0d7..33111739b210 100644
>>> --- a/drivers/net/ethernet/netronome/nfp/bpf/jit.c
>>> +++ b/drivers/net/ethernet/netronome/nfp/bpf/jit.c
>>> @@ -670,7 +670,7 @@ static int nfp_cpp_memcpy(struct nfp_prog *nfp_prog, 
>>> struct nfp_insn_meta *meta)
>>>         xfer_num = round_up(len, 4) / 4;
>>>
>>>         if (src_40bit_addr)
>>> -               addr40_offset(nfp_prog, meta->insn.src_reg, off, &src_base,
>>> +               addr40_offset(nfp_prog, meta->insn.src_reg * 2, off, 
>>> &src_base,
>>>                               &off);
>>
>> Did this break other cases before this patch?
>>
>> I am sorry if this is a dumb question. I don't think I fully
>> understand addr40_offset().
>
> Only map memory uses 40 bit addressing right now, so the if was pretty
> much dead code before the patch.
>
> The memcpy optimization was left out of the initial map support due to
> insufficient test coverage, I should have probably left more of the 40
> bit addressing code out back then.

Thanks for the explanation!

Acked-by: Song Liu <songliubrav...@fb.com>

Reply via email to