BPF List
 help / color / mirror / Atom feed
From: Dongli Zhang <dongli.zhang@oracle.com>
To: David Ahern <dsahern@gmail.com>,
	Menglong Dong <menglong8.dong@gmail.com>
Cc: andrii@kernel.org, ast@kernel.org, bpf@vger.kernel.org,
	daniel@iogearbox.net, davem@davemloft.net, edumazet@google.com,
	imagedong@tencent.com, joao.m.martins@oracle.com,
	joe.jin@oracle.com, kuba@kernel.org,
	linux-kernel@vger.kernel.org, mingo@redhat.com,
	netdev@vger.kernel.org, rostedt@goodmis.org
Subject: Re: [PATCH net-next v3 4/4] net: tun: track dropped skb via kfree_skb_reason()
Date: Fri, 25 Feb 2022 08:49:10 -0800	[thread overview]
Message-ID: <ce8e438b-b077-6cbb-358a-3ffa5cdeb574@oracle.com> (raw)
In-Reply-To: <41d055e3-9d88-bc43-cb3b-bd67ab071e11@gmail.com>

Hi David and Menglong,

On 2/25/22 7:48 AM, David Ahern wrote:
> On 2/24/22 10:57 PM, Menglong Dong wrote:
>>>>
>>>> For tun unique filters, how about using a shortened version of the ioctl
>>>> name used to set the filter.
>>>>
>>>
>>> Although TUN is widely used in virtualization environment, it is only one of
>>> many drivers. I prefer to not introduce a reason that can be used only by a
>>> specific driver.
>>>
>>> In order to make it more generic and more re-usable (e.g., perhaps people may
>>> add ebpf filter to TAP driver as well), how about we create below reasons.
>>>
>>> SKB_DROP_REASON_DEV_FILTER,     /* dropped by filter attached to
>>> 				 * or directly implemented by a
>>> 				 * specific driver
>>> 				 */
>>> SKB_DROP_REASON_BPF_DEV,	/* dropped by bpf directly
>>> 				 * attached to a specific device,
>>> 				 * e.g., via TUNSETFILTEREBPF
>>> 				 */
>>
>> Aren't DEV_FILTER and BPF_DEV too generic? eBPF atached to netdev can
>> be many kinds, such as XDP, TC, etc.
> 
> yes.
> 
>>
>> I think that use TAP_TXFILTER instaed of DEV_FILTER maybe better?
>> and TAP_FILTER->BPF_DEV. Make them similar to the name in
>> __tun_chr_ioctl() may be easier for user to understand.
>>
> 
> in this case given the unique attach points and API tap in the name
> seems more appropriate
> 

Thank you very much for the suggestions.

I will add below in the next version.

SKB_DROP_REASON_TAP_TXFILTER,	/* dropped by tx filter implemented at
				 * tun/tap, e.g., check_filter()
				 */
SKB_DROP_REASON_TAP_FILTER,	/* dropped by (ebpf) filter directly
				 * attached to tun/tap, e.g., via
				 * TUNSETFILTEREBPF
				 */

Dongli Zhang

  reply	other threads:[~2022-02-25 16:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21  5:34 [PATCH net-next v3 0/3] tun/tap: use kfree_skb_reason() to trace dropped skb Dongli Zhang
2022-02-21  5:34 ` [PATCH net-next v3 1/4] skbuff: introduce kfree_skb_list_reason() Dongli Zhang
2022-02-22  3:20   ` David Ahern
2022-02-21  5:34 ` [PATCH net-next v3 2/4] net: tap: track dropped skb via kfree_skb_reason() Dongli Zhang
2022-02-22  3:24   ` David Ahern
2022-02-22  4:31     ` Dongli Zhang
2022-02-26  8:52       ` Dongli Zhang
2022-02-21  5:34 ` [PATCH net-next v3 3/4] net: tun: split run_ebpf_filter() and pskb_trim() into different "if statement" Dongli Zhang
2022-02-22  3:28   ` David Ahern
2022-02-21  5:34 ` [PATCH net-next v3 4/4] net: tun: track dropped skb via kfree_skb_reason() Dongli Zhang
2022-02-22  3:28   ` David Ahern
2022-02-22  4:45     ` Dongli Zhang
2022-02-22 14:39       ` David Ahern
2022-02-22 18:20         ` Dongli Zhang
2022-02-25  5:57           ` Menglong Dong
2022-02-25 15:48             ` David Ahern
2022-02-25 16:49               ` Dongli Zhang [this message]
2022-02-21 22:53 ` [PATCH net-next v3 0/3] tun/tap: use kfree_skb_reason() to trace dropped skb Dongli Zhang

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=ce8e438b-b077-6cbb-358a-3ffa5cdeb574@oracle.com \
    --to=dongli.zhang@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=edumazet@google.com \
    --cc=imagedong@tencent.com \
    --cc=joao.m.martins@oracle.com \
    --cc=joe.jin@oracle.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=menglong8.dong@gmail.com \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.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