From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 5 Apr 2002 19:34:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 5 Apr 2002 19:34:23 -0500 Received: from parmenion.hosting.pacbell.net ([216.100.98.31]:7824 "EHLO parmenion.hosting.pacbell.net") by vger.kernel.org with ESMTP id ; Fri, 5 Apr 2002 19:34:13 -0500 From: "Adam Khan" To: "'Martin Gadbois'" , Cc: Subject: RE: [Design] suggestions for parallel processing of input and output packets Date: Fri, 5 Apr 2002 16:28:26 -0800 Message-ID: <000001c1dd01$f83d0960$4310a8c0@Adamspc> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal In-Reply-To: <3CAD9CDB.1F0C5D2F@colubris.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Martin, Thanks for the info, extremely helpful. I have a couple more questions. The ipsec_tunnel_start_xmit() and ipsec_rcv() routines run as tasklets. In tasklets there is no sleeping or scheduling, From your notes I can use a kernel thread (BTW, a timer routine would sleep - I don't think thats allowed in this context?) Kernel thread - Is this considered a separate context? Concerns -does the thread sleep - how often is the thread run? Pointers on with kernel threads and sample code will be appreciated. Tia, Adam > > Adam Khan wrote: > > > It appears that you handle multiple packets using the interrupt > > generated by the hardware - I don't have an interrupt. > > My question is if I can for example, in the FS code spawn a kernel > > thread that has a function that polls for completion of the decryption > > and can forward the result via netif_rx. Simarlarly for the encryption > > process a thread to poll/monitor the hardware and then forward the > > results via ip_send. This way I can make multiple processing requests to > > the hardware. > > No problems. > You can emulate H/W easily with software: > - on requests, pass packet to you H/W engine, start a recurring timer > - on timer, check if encryption is done, if so call the callback of the > crypto engine (that will send the packet to the other part (either rx or > tx) > - You handle queues your way, to allow for multithread your encryption. > > In other words, the hardware interrupts only: > - Get packet from H/W > - Call the callback associated with the request. > That can be done with a timer or a kernel thread. There is no necessity to > have H/W interrupt. > >