From owner-freebsd-net@FreeBSD.ORG Mon Mar 24 16:10:00 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89E4E14A for ; Mon, 24 Mar 2014 16:10:00 +0000 (UTC) Received: from mail-la0-x229.google.com (mail-la0-x229.google.com [IPv6:2a00:1450:4010:c03::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EFF51862 for ; Mon, 24 Mar 2014 16:09:59 +0000 (UTC) Received: by mail-la0-f41.google.com with SMTP id gl10so3819428lab.14 for ; Mon, 24 Mar 2014 09:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=efh/MOoEp+ngiJswcPM0V7+8aEtjTuXpACTBrymy40U=; b=i8vt9vabyEIxbxwZFnRIYRv7kNpRyT0W4iG5DDmwzN/72i1T43IvmDTCXXca9YnI/q lgY+Sr3TqkIMLKbx4mxTIgBtHIA0SbjWUkRF25vIsfmKhOuEsNLKSAqNeGNDo0ad0YjU tnbD9423kUdi7xL/g81z3TjuAQbMjhDTEbsalZV91UrtoblkFQ2fdVNfCC5c+d40PM6p KrzRoiNzvMWl68KwZ1PfMcnoL4Xk2xLc7Mc50XVXvh0Qn6rdSXl239McLPqDaoZgzJ6s u1KvJkqU6AirJpFhbitHe2YmnbmyEKmuQJVdmsO4uIT8o1fzj6pxwDGczvAZ0kFoxq+k F89Q== MIME-Version: 1.0 X-Received: by 10.112.156.165 with SMTP id wf5mr2282687lbb.37.1395677397961; Mon, 24 Mar 2014 09:09:57 -0700 (PDT) Sender: rizzo.unipi@gmail.com Received: by 10.114.200.107 with HTTP; Mon, 24 Mar 2014 09:09:57 -0700 (PDT) In-Reply-To: <20140324154522.30664.qmail@f5-external.bushwire.net> References: <20140324154522.30664.qmail@f5-external.bushwire.net> Date: Mon, 24 Mar 2014 17:09:57 +0100 X-Google-Sender-Auth: B411E2F2MK4wECKTZnFiuQ1vfrc Message-ID: Subject: Re: How to make netmap NS_FORWARD work with NR_REG_ONE_NIC? From: Luigi Rizzo To: Mark Delany Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2014 16:10:00 -0000 On Mon, Mar 24, 2014 at 4:45 PM, Mark Delany wrote: > (Very recent fbsd10) > > My application is taking advantage of NR_REG_ONE_NIC to register > separate handlers for each h/w ring. (Pro tip, you must re-open > /dev/netmap each time, a dup() fd doesn't work). > > While good for performance, it unfortunately appears that NS_FORWARD > does not work in this mode - presumably because NR_REG_ONE_NIC doesn't > include the host ring. > correct, this is not a supported mode at the moment. If you want to implement it you should do it into netmap_poll() and create another constant NS_REG_ONE_NIC_SW for the new mode. The difficulty is that we do not really have the equivalent of a multiqueue host port in our system. cheers luigi > Now it's possible I simply have a bug and NS_FORWARD should work with > NR_REG_ONE_NIC - I have demo code I can share if needed - but assuming > for a moment I don't have a bug... > > What's the right way to implement host forwarding with NR_REG_ONE_NIC? > > Do I have to register an independent handler with NR_REG_SW_NIC and > have the h/w ring handlers synchronize with it? If so, I also presume > the NR_REG_SW_NIC handler has to manage transfers in both directions, > yes? > > I'm not keen on that approach if I can avoid it as it introduces > synchronization costs between handlers where previously I needed none. > > I also looked at the kernel module and determined that nr_flags = > NR_REG_ONE_NIC | NR_REG_SW_NIC is invalid. Oh well. That would have > solved my problem nicely. > > > Mark. > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > -- -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2211611 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+-------------------------------