From owner-freebsd-drivers@FreeBSD.ORG Thu Sep 15 14:57:00 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84560106564A for ; Thu, 15 Sep 2011 14:57:00 +0000 (UTC) (envelope-from gbal.naresh@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 457788FC14 for ; Thu, 15 Sep 2011 14:56:59 +0000 (UTC) Received: by gyf2 with SMTP id 2so2736597gyf.13 for ; Thu, 15 Sep 2011 07:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:from:content-type:x-mailer:message-id:date:to :content-transfer-encoding:mime-version; bh=62MD9cMn+iAf1EBmWFte2aJRXk59FjHlbctSpH5Y4dU=; b=EFIz6Qs7J91YDnjr6sqcSOSysvfPmxTfRM96qGb8O0U4YMJL9mLwQ61jDDZXVHwVuB 3TPCIFSvss1Fl+uKUub1VpTpsuJ/lPfr0Y2XOXpowhs1Dox92lG9x5N6tiBgYTk7qlXL JhMsbhIxcZWtv1UKcx/9bE9DMRDLGzl5HaLIc= Received: by 10.68.33.231 with SMTP id u7mr175906pbi.292.1316098619113; Thu, 15 Sep 2011 07:56:59 -0700 (PDT) Received: from [192.168.1.2] ([123.236.149.118]) by mx.google.com with ESMTPS id 4sm23615791pbk.5.2011.09.15.07.56.55 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Sep 2011 07:56:57 -0700 (PDT) From: Naresh Content-Type: text/plain; charset=us-ascii X-Mailer: iPhone Mail (8H7) Message-Id: Date: Thu, 15 Sep 2011 20:26:16 +0530 To: "freebsd-drivers@freebsd.org" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (iPhone Mail 8H7) Subject: Multiple TX queue support in nic driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2011 14:57:00 -0000 Hi All, I am working on a 10G Ethernet driver. I have a requirement to support mult= iple TX queues. I looked into IXGBE and CXGB drivers for reference, I have s= ome questions regarding the implementation. 1) For supporting multiple TXQs, I see the above mentioned drivers create a r= ing buffer in the driver for each hardware TX queue, and queue the packets f= rom stack to the ring buffer before queueing on the hardware queue. I don't u= nderstand why to create a ring buffer for supporting multiple TXQS. There mi= ght be a very good reason for them to do that way, but I am unable to get th= at. Is it ok to queue the packets to hardware queue directly based on the flowid= supplied in the mbuf packet header in if_transmit routine ? 2) Regarding flowid, for the first TX packet the flowid is not set and the p= acket goes out on the default TX queue and when the corresponding RX respons= e comes to hardware it queues the packet to appropriate RXQ based on the r= ss hash. The driver then before posting RX packet to stack it should set the= flowid in packet to RXQ index. After that the TX packets from stack for that TCP connection will come with f= lowid supplied by us. Is this understanding correct ? Can some one please help me on this? Thank you all for being patient in reading this long post. Thanks, Naresh.=