[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20170613.173206.1185302030405741253.davem@davemloft.net>
Date: Tue, 13 Jun 2017 17:32:06 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: brakmo@...com
Cc: netdev@...r.kernel.org, kernel-team@...com, bmatheny@...com,
ast@...com, daniel@...earbox.net, dsa@...ulusnetworks.com
Subject: Re: [RFC PATCH net-next 15/15] bpf: Sample bpf program to set
sndcwnd clamp
From: Lawrence Brakmo <brakmo@...com>
Date: Tue, 13 Jun 2017 11:00:04 -0700
> +SEC("sockops")
> +int bpf_clamp(struct __sk_buff *skb)
> +{
> + struct bpf_socket_ops *skops = (struct bpf_socket_ops *) skb;
> + char fmt1[] = "BPF command: %d\n";
> + char fmt2[] = " Returning %d\n";
> + int op;
> + int rv = 0;
> + int bufsize = 150000;
> + int clamp = 100;
> + int to_init = 10;
> +
> + // For testing purposes, only execute rest of BPF program
> + // if neither port numberis 55601
> + if (skops->remote_port != 55601 && skops->local_port != 55601)
> + return -1;
Local variable ordering and C++ comments.
Powered by blists - more mailing lists