From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 6630F3B2A4 for ; Wed, 1 Aug 2018 12:35:25 -0400 (EDT) Received: by mail-pg1-x532.google.com with SMTP id z8-v6so11076889pgu.8 for ; Wed, 01 Aug 2018 09:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eHhZ5Pcv+lV1TSqMvbaI03wFk99AGFajb5wDVVRvgPE=; b=Ch3zQsaBdU6y1UDnK2gfvSowVgeqaZfqju6orppA/NSPouWzR3sfR2qhhXKS79slT3 Rgi1vF3sH2GrgXQJo1HTaQGrj24PJW7C6oenp2mVglHC8f5gGYBi8qYs+qTuEe6tQLYD QABinF7vtPKnjsGHzIXH2ekXEIawArcdIP2H9ak+2L/TnEDUBx0oC1qybmhjg1Ct5w2m ICDDSSJhufRjP9jv9mkv/BtImtuV/0BaqGOzlnnjgPoXaWzy3T9/qN4/M5xjodDAp/6z Af+a20qcGRaUIFknWx6jNGpOkePdhOMrRu3V+qJURX2sEkj59gcf76bY4pdLaSNoLrnN k6Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eHhZ5Pcv+lV1TSqMvbaI03wFk99AGFajb5wDVVRvgPE=; b=S3oZyV9eUQtO6ZGt8Uva+Tilw92CENwPP/lzO848RGKsax1joKIjzRHMyWhryz0Uuj Pq7e/Hd4cfzHE3YpnKDu3N0AKTNpbyBrMAg1MitW21fmaoSOcL6eeD9fHOkbe4bzSBF5 vb1SMP5QebYOGj17rI456AzxF4gNF8w48oiGH/xEmfk67BgpkXHJrAeZsI8PcieDznih Y35KbmL9B82ZXHyeKQMjSL7/+v71auPB4E5UTAX9Q7Ifgx/YtCou5Hm9wo0c18D2rSpP BYXmAHCQChzymjIVMaxuoEgR8QBq9NREbbxIYt3UtEjgZRze4Tp3LQImw5lDvi2GAfi1 Or1w== X-Gm-Message-State: AOUpUlEN3TxELqCx9wA5F9D7Jn84d75448/xlwAqLedpB4Ktd/V+EuJY 6XqxjT10Q7BEv/Uno4smNbxQ0g== X-Google-Smtp-Source: AAOMgpdcm2o+qiFxSoimpbHfaM2lk1vjwNuQba8d+mGrenqPP2xAULRcfNLu4T7bC/hHt86Dw2Q5Nw== X-Received: by 2002:a63:5c10:: with SMTP id q16-v6mr25373425pgb.452.1533141324599; Wed, 01 Aug 2018 09:35:24 -0700 (PDT) Received: from xeon-e3 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id q21-v6sm32789651pfl.156.2018.08.01.09.35.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Aug 2018 09:35:24 -0700 (PDT) Date: Wed, 1 Aug 2018 09:35:22 -0700 From: Stephen Hemminger To: Dave Taht Cc: Cake List Message-ID: <20180801093522.22c1f043@xeon-e3> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Cake] passing args to bpf programs X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Aug 2018 16:35:25 -0000 On Wed, 1 Aug 2018 09:22:41 -0700 Dave Taht wrote: > this really isn't the right list for this... but I wanted to build on > the ack_filter bpf code I had, to create impairments, like dropping > acks every X packets, or randomly, or when a specific pattern is seen > (like timestamps or sack). This was sort of the reverse complement to > getting the cake ack-filter right, now that I know everything that can > go wrong... > > I see I can return ACT_SHOT, so I can drop packets. > > But what I can't quite figure out is how to pass args to an tc ebpf > program. Do I have to pass those via a file descriptor? A map > generated elsewhere? what? Sure as heck don't want to compile one > program per opt.... > > Simplest args would be: > > max 16 - drop every 16th ack packet > random 24 - drop randomly between 0 24 > match only certain flags > > followed by more gnarly ones like: > > miscalculate if I have a payload or not > drop sack > mangle timestamps > With Xnetem, I ended up creating a map of config options.