From owner-freebsd-net@freebsd.org Mon Nov 5 13:18:30 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00EBE1101B7F for ; Mon, 5 Nov 2018 13:18:30 +0000 (UTC) (envelope-from architpandeynitk@gmail.com) Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 132B17EA3D for ; Mon, 5 Nov 2018 13:18:29 +0000 (UTC) (envelope-from architpandeynitk@gmail.com) Received: by mail-pl1-x62c.google.com with SMTP id w22-v6so1134143plk.0 for ; Mon, 05 Nov 2018 05:18:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=CP6+PxhZvsNjcP+X03bJAFp8Hp+ltP6frJnLfs0Uc0c=; b=H/vPGBKifWt6za6dE2hReokKfDLkj4FVtCOXyoQQSW1PegCwHNMVlojCdxLQLEOrk/ PrbbFtqZ4J6gmPfjEkQWpZUuHtySuxxazyxhm6m+dOI6FNosQimI137L0/Cd6N2eRJ5K p+xZeH3TpBJotrY7iZF8tHXxiMkf+3I5fxjynfpMi2VKDDxTgyCxeXewf5ru7dH8wesw IyfUSn06SWkIDs/LNcXBzUQeNpdl4esOV+0JMSuY4113S6+eHpAvRIxOi/518dFfkF4P c48XUwEb2dz7W+79VS6HC4h9hVmGmt9cjDeeRZQK/8jZx2igG5ePFnIa4wsy8gzNdSau Nijw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=CP6+PxhZvsNjcP+X03bJAFp8Hp+ltP6frJnLfs0Uc0c=; b=SAfx4SCxj5xzGLGSMGwi61OrGR7fbB8KgPFYJlfYNMgEVZkA5Q35ll8kAs39KWRlTa d4ZPI1ZMJ7JijIOP+8ki//keR1KiCGq34Cb8GZSVWgOS14ksS9qrkiGEtw4cHkz9eQ2e rRR16X2Ewdmn3ngn0+A/vTYtI72vV1+KuUDi8sSzFGbNTNyQvK/Mh4KbVvaVLf2Vv6iy hxwuuxIo1iIfpMW23GAiG08B08Wc7E3AxtjnTO+9Gi2D/azy1kRCR9S/G+MocxDn4y+H /JYG7xvaS/5IQHGPQpPgwJmjQ50o6QXDG01UdAHmhYile+feWOMr1L9vnfRTkPqTbxd6 pPJA== X-Gm-Message-State: AGRZ1gIb5SRtuf1mpfpUXgJ48rzlHzromPjvNm1tm98nPWJVDlPKBUu0 Ox/59ViOQf/qMQet1eg46qc= X-Google-Smtp-Source: AJdET5du7ey1IAydE6/POyvb/Git3b3kmOub+rfWXABNCivrGfzykJWiqCUZBbuQUc8/yxgbdRr5zg== X-Received: by 2002:a17:902:748c:: with SMTP id h12-v6mr556022pll.168.1541423907869; Mon, 05 Nov 2018 05:18:27 -0800 (PST) Received: from [10.52.84.250] ([14.139.155.214]) by smtp.gmail.com with ESMTPSA id r4sm18381611pgn.54.2018.11.05.05.18.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 05:18:27 -0800 (PST) To: freebsd-net@freebsd.org, anandtarun2@gmail.com From: Archit Pandey Subject: Help adding Adaptive RED to Existing RED Code Message-ID: Date: Mon, 5 Nov 2018 18:48:24 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 132B17EA3D X-Spamd-Result: default: False [-3.20 / 200.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com]; NEURAL_HAM_MEDIUM(-0.96)[-0.963,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[c.2.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.85)[-0.854,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.37)[ipnet: 2607:f8b0::/32(-0.51), asn: 15169(-1.27), country: US(-0.06)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 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, 05 Nov 2018 13:18:30 -0000 Hello all! We are working on implementing Adaptive RED over existing RED code that can be found in /sys/net/altq/altq_red.c and /sys/net/altq/altq.h. We have added the following fields and functions to the source: 1. In /sys/net/altq/altq_red.h         Added to struct red_t:             struct callout adaptive_callout;             int target_min;             int target_max; 2. In /sys/net/altq/altq_red.c         Functions added:              void red_adaptive_timer(): function that is responsible for scheduling a callout for red_adaptive_algo() every 500ms             void red_adaptive_algo(): function that adjusts the drop probability. The most important part of the algorithm is the fact that it is called every 500ms. We are unable to make that happen. We found resources online pointing us to use callout_init(), callout_reset() and callout_schedule(). However, we couldn't find documentation on how to use them correctly and in what order. Would really appreciate it if someone could point us to useful resources, or could give us an example of using those functions. Thanks for your time. Warm regards, --- Archit Pandey Junior Year Undergrad Department of Computer Science and Engineering National Institute of Technology Karnataka Surathkal, India