netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: Andrii Nakryiko <andrii@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Mykola Lysenko <mykolal@fb.com>, Jakub Kicinski <kuba@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	bpf@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH bpf-next v4 1/2] bpf: add CHECKSUM_COMPLETE to bpf test progs
Date: Thu, 13 Jun 2024 12:18:02 +0100	[thread overview]
Message-ID: <895c8713-85a7-48a6-a42c-2c1ac4fe2274@linux.dev> (raw)
In-Reply-To: <20240612074917.1afacc42@kernel.org>

On 12/06/2024 15:49, Jakub Kicinski wrote:
> On Thu, 6 Jun 2024 07:58:50 -0700 Vadim Fedorenko wrote:
>> @@ -1060,9 +1062,19 @@ int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr,
>>   		__skb_push(skb, hh_len);
>>   	if (is_direct_pkt_access)
>>   		bpf_compute_data_pointers(skb);
>> +
>>   	ret = convert___skb_to_skb(skb, ctx);
>>   	if (ret)
>>   		goto out;
>> +
>> +	if (kattr->test.flags & BPF_F_TEST_SKB_CHECKSUM_COMPLETE) {
>> +		const int off = skb_network_offset(skb);
>> +		int len = skb->len - off;
>> +
>> +		skb->csum = skb_checksum(skb, off, len, 0);
>> +		skb->ip_summed = CHECKSUM_COMPLETE;
>> +	}
> 
> Looks good, overall, although I'd be tempted to place this before
> the L2 is pushed, a few lines up, so that we don't need to worry
> about network offset. Then again, with you approach there is a nice
> symmetry between the pre- and post- if blocks so either way is fine:
> 
> Reviewed-by: Jakub Kicinski <kuba@kernel.org>

Hi Daniel!

Could you please take a look and merge the series?

Thanks,
Vadim

  reply	other threads:[~2024-06-13 11:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 14:58 [PATCH bpf-next v4 1/2] bpf: add CHECKSUM_COMPLETE to bpf test progs Vadim Fedorenko
2024-06-06 14:58 ` [PATCH bpf-next v4 2/2] selftests: bpf: validate CHECKSUM_COMPLETE option Vadim Fedorenko
2024-06-12 14:49 ` [PATCH bpf-next v4 1/2] bpf: add CHECKSUM_COMPLETE to bpf test progs Jakub Kicinski
2024-06-13 11:18   ` Vadim Fedorenko [this message]
2024-06-13 12:32     ` Daniel Borkmann
2024-06-13 12:40 ` patchwork-bot+netdevbpf

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=895c8713-85a7-48a6-a42c-2c1ac4fe2274@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kuba@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mykolal@fb.com \
    --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).