From patchwork Mon Apr 25 11:18:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 92743 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DC236B6EF2 for ; Mon, 25 Apr 2011 21:18:23 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758371Ab1DYLST (ORCPT ); Mon, 25 Apr 2011 07:18:19 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:41734 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758390Ab1DYLSS (ORCPT ); Mon, 25 Apr 2011 07:18:18 -0400 Received: by fxm17 with SMTP id 17so1241397fxm.19 for ; Mon, 25 Apr 2011 04:18:17 -0700 (PDT) Received: by 10.223.160.8 with SMTP id l8mr1464750fax.114.1303730296954; Mon, 25 Apr 2011 04:18:16 -0700 (PDT) Received: from monstr.eu ([178.23.216.97]) by mx.google.com with ESMTPS id g5sm1660665faa.26.2011.04.25.04.18.15 (version=SSLv3 cipher=OTHER); Mon, 25 Apr 2011 04:18:16 -0700 (PDT) Message-ID: <4DB55876.2010008@monstr.eu> Date: Mon, 25 Apr 2011 13:18:14 +0200 From: Michal Simek Reply-To: monstr@monstr.eu User-Agent: Thunderbird 2.0.0.22 (X11/20090625) MIME-Version: 1.0 To: Eric Dumazet CC: juice@swagman.org, netdev@vger.kernel.org Subject: Re: Hight speed data sending from custom IP out of kernel References: <53f539ea861e1a24bde4aadceff0b3bb.squirrel@www.liukuma.net> <4DAD76F1.40309@monstr.eu> <45cb2254ff23a4977c95b0f9459e39a6.squirrel@www.liukuma.net> <4DAFE4A0.2030905@monstr.eu> <1303373925.3685.6.camel@edumazet-laptop> In-Reply-To: <1303373925.3685.6.camel@edumazet-laptop> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, Eric Dumazet wrote: > Le jeudi 21 avril 2011 à 10:02 +0200, Michal Simek a écrit : > >> Thanks for that. I am looking at pktgen. On UDP my system is able to send full >> bandwidth on 100Mbit/s ethernet and 220Mbit/s on 1G/s. >> I will let you know when I have any useful resutls. > > 220Mbits/s in pktgen or an application ? > - how many packets per second ? (or packet size ?) > > pktgen has the "clone_skb 100" thing that avoid skb_alloc()/skb_free() > overhead, and permits to really test driver performance. > > It also bypass qdisc management. > I have reused the part of code from pktgen and I have found that I am missing some IDs that's why I have done one simple patch(below) in pktgen which is update IP ID field to find out if all packets are sent or not. As you suggest I am also missing some IDs here. My question is if I can use any mechanism to ensure to sending all IDs? The next my question about packet fragments. Is it possible to setup IP fragments from higher level? I do it on low level as pktgen and I have change page address to memory which I need to send but it in under UDP. The point is to create packet with frags > 1 where the first fragment is IP/TCP header and the second fragments contains pointer to data which are prepared in the memory and will be copied directly by network driver. I am doing the same hacked code from pktgen. Is it possible to do it on higher level? Thanks, Michal For 2.6.37.6 diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 33bc382..3429eb3 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -3500,6 +3500,13 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev) pkt_dev->last_pkt_size = pkt_dev->skb->len; pkt_dev->allocated_skbs++; pkt_dev->clone_count = 0; /* reset counter */ + } else { + struct iphdr *iph; + iph = ip_hdr(pkt_dev->skb); + iph->id = htons(pkt_dev->ip_id); + pkt_dev->ip_id++; + iph->check = 0; + iph->check = ip_fast_csum((void *)iph, iph->ihl); } if (pkt_dev->delay && pkt_dev->last_ok)