From owner-freebsd-net@freebsd.org Wed Jun 15 23:15:25 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00275A478F8 for ; Wed, 15 Jun 2016 23:15:24 +0000 (UTC) (envelope-from andy.yakov@ya.ru) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id DB4781CA7 for ; Wed, 15 Jun 2016 23:15:24 +0000 (UTC) (envelope-from andy.yakov@ya.ru) Received: by mailman.ysv.freebsd.org (Postfix) id D6B28A478F6; Wed, 15 Jun 2016 23:15:24 +0000 (UTC) Delivered-To: net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D65DEA478F5 for ; Wed, 15 Jun 2016 23:15:24 +0000 (UTC) (envelope-from andy.yakov@ya.ru) Received: from forward5o.cmail.yandex.net (forward5o.cmail.yandex.net [IPv6:2a02:6b8:0:1a72::28a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9026C1CA6 for ; Wed, 15 Jun 2016 23:15:24 +0000 (UTC) (envelope-from andy.yakov@ya.ru) Received: from mxback6o.mail.yandex.net (mxback6o.mail.yandex.net [37.140.190.20]) by forward5o.cmail.yandex.net (Yandex) with ESMTP id 14F6C20BEF; Thu, 16 Jun 2016 02:15:10 +0300 (MSK) Received: from web23o.yandex.ru (web23o.yandex.ru [95.108.205.123]) by mxback6o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id YULR402WVY-FAWONwaV; Thu, 16 Jun 2016 02:15:10 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1466032510; bh=AlmwrRVuDxa+bYucSWNdzgn484MxjBfcY2Hovd5sxFc=; h=X-Yandex-Sender-Uid:From:Envelope-From:To:In-Reply-To:References: Subject:MIME-Version:Message-Id:X-Mailer:Date: Content-Transfer-Encoding:Content-Type; b=te6zkuPoXkbRvF2LNSEIGQkA6w7gRK9ZvQtiyQkP6xsS6T5wLSaJSRr5cDJGIxoPG zrmZeDBnJqq8rvlI3+M0KLF72U8eTylurNnGEEKx8B2s5w4wUZf1jQ4bmUU7lcv+Nz 1cl0GLeOUdF7KQcXqZnFJ/b23HnbZ/TjvEO2mS9M= Authentication-Results: mxback6o.mail.yandex.net; dkim=pass header.i=@ya.ru X-Yandex-Suid-Status: 1 0,1 0,1 896244277 X-Yandex-Sender-Uid: 359195858 Received: by web23o.yandex.ru with HTTP; Thu, 16 Jun 2016 02:15:10 +0300 From: Andrey Yakovlev Envelope-From: andy-yakov@yandex.ru To: Dominik Schoeffmann , "net@freebsd.org" In-Reply-To: <57601DFA.2040008@in.tum.de> References: <57601DFA.2040008@in.tum.de> Subject: Re: Netmap Checksum Offloading MIME-Version: 1.0 Message-Id: <470941466032510@web23o.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Wed, 15 Jun 2016 20:15:10 -0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 23:15:25 -0000 ive heard on bsdcan this year that some patches exist to add hwcsum offloading to netmap, hope to see it chelsio at least --  ./andy 14.06.2016, 12:15, "Dominik Schoeffmann" : > Dear Netmap Developers, > > during the course of my bachelor's thesis, I modified a packet generator > called MoonGen [1] in order to utilize netmap. > One key component was to flexibly offload checksums for different kinds > of packets (IPv4, UDP, TCP). > The ixgbe netmap patch was modified [2] in order to construct context > descriptors and suitable data descriptors. This is implemented in less > than 250 LoC (including pseudo-header calculations). > The man page states, that checksum offloading is available via ethtool, > although a solution inside the netmap API might be a cleaner way for > applications to actually use these features. > Attached is a graph showing the performance implication of using > offloading in the current implementation. > As can be seen, offloading has only a minor impact. > When regarding this data (and comparing it to other frameworks), please > keep in mind, that internally a lot of per-packet effort is needed due > to the software architecture of the packet generator. > > The question being: > Would it not make sense to include checksum offloading inside of netmap > in order to accomodate applications operating on layer 3 and above? > As these programs need to calculate the checksums in software, it would > be just as fast to move these calculations to the kernel for NICs > without checksum offloading support (and the kernel would act as a library). > The problem which currently is imposed by the fact, that netmap exports > the complete ring, is that context descriptors disrupt the data > descriptors, which is unpleasant for the application. > But you may find the data interesting nevertheless. > > Best Regards, > Dominik Schoeffmann > > [1] https://github.com/dschoeffm/MoonGen/tree/netmap > [2] https://github.com/dschoeffm/netmap/tree/mg-chksum-offloading