Merge "Revert "ANDROID: net: ipv4: sysfs_net_ipv4: Add sysfs-based knobs for controlling TCP window size""
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
1ea01c7be2
@@ -1345,7 +1345,7 @@ static inline void tcp_sack_reset(struct tcp_options_received *rx_opt)
|
||||
rx_opt->num_sacks = 0;
|
||||
}
|
||||
|
||||
u32 tcp_default_init_rwnd(const struct sock *sk, u32 mss);
|
||||
u32 tcp_default_init_rwnd(u32 mss);
|
||||
void tcp_cwnd_restart(struct sock *sk, s32 delta);
|
||||
|
||||
static inline void tcp_slow_start_after_idle_check(struct sock *sk)
|
||||
|
||||
@@ -20,7 +20,6 @@ obj-$(CONFIG_BPFILTER) += bpfilter/
|
||||
|
||||
obj-$(CONFIG_NET_IP_TUNNEL) += ip_tunnel.o
|
||||
obj-$(CONFIG_SYSCTL) += sysctl_net_ipv4.o
|
||||
obj-$(CONFIG_SYSFS) += sysfs_net_ipv4.o
|
||||
obj-$(CONFIG_PROC_FS) += proc.o
|
||||
obj-$(CONFIG_IP_MULTIPLE_TABLES) += fib_rules.o
|
||||
obj-$(CONFIG_IP_MROUTE) += ipmr.o
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* net/ipv4/sysfs_net_ipv4.c
|
||||
*
|
||||
* sysfs-based networking knobs (so we can, unlike with sysctl, control perms)
|
||||
*
|
||||
* Copyright (C) 2008 Google, Inc.
|
||||
*
|
||||
* Robert Love <rlove@google.com>
|
||||
*
|
||||
* This software is licensed under the terms of the GNU General Public
|
||||
* License version 2, as published by the Free Software Foundation, and
|
||||
* may be copied, distributed, and modified under those terms.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/init.h>
|
||||
#include <net/tcp.h>
|
||||
|
||||
#define CREATE_IPV4_FILE(_name, _var) \
|
||||
static ssize_t _name##_show(struct kobject *kobj, \
|
||||
struct kobj_attribute *attr, char *buf) \
|
||||
{ \
|
||||
return sprintf(buf, "%d\n", _var); \
|
||||
} \
|
||||
static ssize_t _name##_store(struct kobject *kobj, \
|
||||
struct kobj_attribute *attr, \
|
||||
const char *buf, size_t count) \
|
||||
{ \
|
||||
int val, ret; \
|
||||
ret = sscanf(buf, "%d", &val); \
|
||||
if (ret != 1) \
|
||||
return -EINVAL; \
|
||||
if (val < 0) \
|
||||
return -EINVAL; \
|
||||
_var = val; \
|
||||
return count; \
|
||||
} \
|
||||
static struct kobj_attribute _name##_attr = \
|
||||
__ATTR(_name, 0644, _name##_show, _name##_store)
|
||||
|
||||
CREATE_IPV4_FILE(tcp_wmem_min, init_net.ipv4.sysctl_tcp_wmem[0]);
|
||||
CREATE_IPV4_FILE(tcp_wmem_def, init_net.ipv4.sysctl_tcp_wmem[1]);
|
||||
CREATE_IPV4_FILE(tcp_wmem_max, init_net.ipv4.sysctl_tcp_wmem[2]);
|
||||
|
||||
CREATE_IPV4_FILE(tcp_rmem_min, init_net.ipv4.sysctl_tcp_rmem[0]);
|
||||
CREATE_IPV4_FILE(tcp_rmem_def, init_net.ipv4.sysctl_tcp_rmem[1]);
|
||||
CREATE_IPV4_FILE(tcp_rmem_max, init_net.ipv4.sysctl_tcp_rmem[2]);
|
||||
|
||||
static struct attribute *ipv4_attrs[] = {
|
||||
&tcp_wmem_min_attr.attr,
|
||||
&tcp_wmem_def_attr.attr,
|
||||
&tcp_wmem_max_attr.attr,
|
||||
&tcp_rmem_min_attr.attr,
|
||||
&tcp_rmem_def_attr.attr,
|
||||
&tcp_rmem_max_attr.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
static struct attribute_group ipv4_attr_group = {
|
||||
.attrs = ipv4_attrs,
|
||||
};
|
||||
|
||||
static __init int sysfs_ipv4_init(void)
|
||||
{
|
||||
struct kobject *ipv4_kobject;
|
||||
int ret;
|
||||
|
||||
ipv4_kobject = kobject_create_and_add("ipv4", kernel_kobj);
|
||||
if (!ipv4_kobject)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = sysfs_create_group(ipv4_kobject, &ipv4_attr_group);
|
||||
if (ret) {
|
||||
kobject_put(ipv4_kobject);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
subsys_initcall(sysfs_ipv4_init);
|
||||
Reference in New Issue
Block a user