From owner-cvs-all@FreeBSD.ORG Tue Jul 5 17:35:20 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E5E9116A41C; Tue, 5 Jul 2005 17:35:20 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D146B43D53; Tue, 5 Jul 2005 17:35:20 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j65HZKuf019007; Tue, 5 Jul 2005 17:35:20 GMT (envelope-from glebius@repoman.freebsd.org) Received: (from glebius@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j65HZK06019006; Tue, 5 Jul 2005 17:35:20 GMT (envelope-from glebius) Message-Id: <200507051735.j65HZK06019006@repoman.freebsd.org> From: Gleb Smirnoff Date: Tue, 5 Jul 2005 17:35:20 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/netgraph netgraph.h ng_base.c ng_socket.c ng_socketvar.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2005 17:35:21 -0000 glebius 2005-07-05 17:35:20 UTC FreeBSD src repository Modified files: sys/netgraph netgraph.h ng_base.c ng_socket.c ng_socketvar.h Log: In the splnet times, netgraph was functional and synchronous. Nowadays, an item may be queued and processed later. While this is OK for mbufs, this is a problem for control messages. In the framework: - Add optional callback function pointer to an item. When item gets applied the callback is executed from ng_apply_item(). - Add new flag NG_PROGRESS. If this flag is supplied, then return EINPROGRESS instead of 0 in case if item failed to deliver synchronously and was queued. - Honor NG_PROGRESS in ng_snd_item(). In ng_socket: - When userland sends control message add callback to the item. - If ng_snd_item() returns EINPROGRESS, then sleep. This change fixes possible races in ngctl(8) scripts. Reviewed by: julian Approved by: re (scottl) Revision Changes Path 1.55 +8 -0 src/sys/netgraph/netgraph.h 1.102 +28 -2 src/sys/netgraph/ng_base.c 1.67 +44 -1 src/sys/netgraph/ng_socket.c 1.10 +2 -0 src/sys/netgraph/ng_socketvar.h