From owner-freebsd-hackers@freebsd.org Tue Jun 2 17:19:48 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20FD82F4AB3; Tue, 2 Jun 2020 17:19:48 +0000 (UTC) (envelope-from ankur.kothiwal99@gmail.com) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49bzLW17z6z4K9L; Tue, 2 Jun 2020 17:19:46 +0000 (UTC) (envelope-from ankur.kothiwal99@gmail.com) Received: by mail-qk1-f178.google.com with SMTP id v79so13248204qkb.10; Tue, 02 Jun 2020 10:19:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=0ZJaPpBX9kF5a3yJvUNlpg+PWeIWVrIZP9+UhJoVmwE=; b=gB+K2Gku46nV3ybaXiHnt3Ed9ebx6DiaWUnDgkEarrmwF6l1e7kfFo+IiICpizv5in 5hoQqEPN1r4MP7LXxj7Q0UiA6Xv2Zel84WZgNAaRL5+iNas9QRGi/b/Y/RIi+pfwX0J3 H+k+bbB5R9T/y9aWx+Tu7eKxGFgpHi/Ho4ldZOsLv2PllNU4i7gHNWQwkrgwAeUOt9FO B0ncW5Rls0U0nT+7gk5/NrYw5Tx3TVkh15PTzxE0JiaaDX16JGWJvNIoJZt0Thca6xOm J0D+gQ2nO4Bn8tUegmiUqhedkiyAJ0jsHONrESgQ/3lf88cg5fQRZanpvOxa1RoBIx4G HTNw== X-Gm-Message-State: AOAM533bMEpDBOBbTsHLVr7mU9823M8lvJsUy8u0/z8didDVN4Gxyk19 LF9MIr0KDsHczxQk8rV6uL+IAufI/MWPhWXE X-Google-Smtp-Source: ABdhPJygpVRcl2A0dDLRvkFekMBxXwXMoK0QHLnK7I5ZaJ91VUiZgPO52GzVqBoXNFBKzjiybaKH6g== X-Received: by 2002:a05:620a:1281:: with SMTP id w1mr2133804qki.462.1591118385581; Tue, 02 Jun 2020 10:19:45 -0700 (PDT) Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com. [209.85.160.177]) by smtp.gmail.com with ESMTPSA id w10sm3234994qtc.15.2020.06.02.10.19.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Jun 2020 10:19:45 -0700 (PDT) Received: by mail-qt1-f177.google.com with SMTP id y1so11246729qtv.12; Tue, 02 Jun 2020 10:19:44 -0700 (PDT) X-Received: by 2002:ac8:f7b:: with SMTP id l56mr8124539qtk.127.1591118384295; Tue, 02 Jun 2020 10:19:44 -0700 (PDT) MIME-Version: 1.0 From: Ankur Kothiwal Date: Tue, 2 Jun 2020 22:49:18 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: [GSoC'20 Introduction] eBPF XDP Hook To: freebsd-hackers@freebsd.org, soc-status@freebsd.org Cc: rstone@freebsd.org, hrs@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 49bzLW17z6z4K9L X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of ankurkothiwal99@gmail.com designates 209.85.222.178 as permitted sender) smtp.mailfrom=ankurkothiwal99@gmail.com X-Spamd-Result: default: False [-2.03 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[ankur@freebsd.org,ankurkothiwal99@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCVD_TLS_ALL(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.980]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_MEDIUM(-0.82)[-0.823]; NEURAL_HAM_SHORT(-0.22)[-0.225]; RCVD_IN_DNSWL_NONE(0.00)[209.85.222.178:from]; FORGED_SENDER(0.30)[ankur@freebsd.org,ankurkothiwal99@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.222.178:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; TAGGED_FROM(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2020 17:19:48 -0000 Hello everyone, Project: Implement eBPF XDP for FreeBSD by extending VirtIO ethernet driver if_vtnet The goal of this project is to extend an existing FreeBSD network driver ,VirtIO if_vtnet to be able to call into an eBPF program when processing a newly received packet. The driver will perform the basic actions of XDP like PASS, DROP, TX or REDIRECT the packet as specified by the program. The project will also implement new map type and other eBPF helper functions.The aim of this project is to add new probe sites into the kernel that will call eBPF functions Mentors: Ryan Stone and Hiroki Sato Approach for the project: The project aims to extend the NIC driver =E2=80=9Cif_vtnet=E2=80=9D to sup= port XDP. The approach is to write a XDP hook as a pfil (packet filter) hook (https://svnweb.freebsd.org/changeset/base/356613) in the vtnet_rxq_eof() function which is the function that deals with receiving the packets from the driver. This approach will help the XDP hook to work on any driver that supports pfil (like mlx5en). The function will take XDP actions (like PASS, DROP etc) on the packet which will further be processed by the eBPF program. Project GSoC Wiki: https://wiki.freebsd.org/SummerOfCodeIdeas#eBPF_XDP_Hook= s Github Repo for the code: https://github.com/rysto32/freebsd/tree/ebpf-import FreeBSD Wiki Student: https://wiki.freebsd.org/AnkurKothiwal Project: https://wiki.freebsd.org/SummerOfCode2020Projects/eBPFXDPHooks Thank you for giving your time to read. Please feel free to share your feedback and suggestion. Thanks and Regards Ankur Kothiwal