Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315773
b: refs/heads/master
c: fd183f6
h: refs/heads/master
i:
  315771: 798bf53
v: v3
  • Loading branch information
David S. Miller committed Jul 22, 2012
1 parent a3f5ade commit 5a6103a
Show file tree
Hide file tree
Showing 23 changed files with 252 additions and 42 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 76886596921dd0e058f7f0a16de6151629390d15
refs/heads/master: fd183f6a73fc0ff3e32c636dbb539e35d4c530c9
14 changes: 14 additions & 0 deletions trunk/Documentation/networking/ip-sysctl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,20 @@ path_max_retrans - INTEGER

Default: 5

pf_retrans - INTEGER
The number of retransmissions that will be attempted on a given path
before traffic is redirected to an alternate transport (should one
exist). Note this is distinct from path_max_retrans, as a path that
passes the pf_retrans threshold can still be used. Its only
deprioritized when a transmission path is selected by the stack. This
setting is primarily used to enable fast failover mechanisms without
having to reduce path_max_retrans to a very low value. See:
http://www.ietf.org/id/draft-nishida-tsvwg-sctp-failover-05.txt
for details. Note also that a value of pf_retrans > path_max_retrans
disables this feature

Default: 0

rto_initial - INTEGER
The initial round trip timeout value in milliseconds that will be used
in calculating round trip times. This is the initial time interval
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ static struct rtnl_link_stats64 *dummy_get_stats64(struct net_device *dev,

dstats = per_cpu_ptr(dev->dstats, i);
do {
start = u64_stats_fetch_begin(&dstats->syncp);
start = u64_stats_fetch_begin_bh(&dstats->syncp);
tbytes = dstats->tx_bytes;
tpackets = dstats->tx_packets;
} while (u64_stats_fetch_retry(&dstats->syncp, start));
} while (u64_stats_fetch_retry_bh(&dstats->syncp, start));
stats->tx_bytes += tbytes;
stats->tx_packets += tpackets;
}
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/ethernet/neterion/vxge/vxge-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3131,12 +3131,12 @@ vxge_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats)
u64 packets, bytes, multicast;

do {
start = u64_stats_fetch_begin(&rxstats->syncp);
start = u64_stats_fetch_begin_bh(&rxstats->syncp);

packets = rxstats->rx_frms;
multicast = rxstats->rx_mcast;
bytes = rxstats->rx_bytes;
} while (u64_stats_fetch_retry(&rxstats->syncp, start));
} while (u64_stats_fetch_retry_bh(&rxstats->syncp, start));

net_stats->rx_packets += packets;
net_stats->rx_bytes += bytes;
Expand All @@ -3146,11 +3146,11 @@ vxge_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats)
net_stats->rx_dropped += rxstats->rx_dropped;

do {
start = u64_stats_fetch_begin(&txstats->syncp);
start = u64_stats_fetch_begin_bh(&txstats->syncp);

packets = txstats->tx_frms;
bytes = txstats->tx_bytes;
} while (u64_stats_fetch_retry(&txstats->syncp, start));
} while (u64_stats_fetch_retry_bh(&txstats->syncp, start));

net_stats->tx_packets += packets;
net_stats->tx_bytes += bytes;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ static struct rtnl_link_stats64 *loopback_get_stats64(struct net_device *dev,

lb_stats = per_cpu_ptr(dev->lstats, i);
do {
start = u64_stats_fetch_begin(&lb_stats->syncp);
start = u64_stats_fetch_begin_bh(&lb_stats->syncp);
tbytes = lb_stats->bytes;
tpackets = lb_stats->packets;
} while (u64_stats_fetch_retry(&lb_stats->syncp, start));
} while (u64_stats_fetch_retry_bh(&lb_stats->syncp, start));
bytes += tbytes;
packets += tpackets;
}
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,16 +704,16 @@ static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev,
u64 tpackets, tbytes, rpackets, rbytes;

do {
start = u64_stats_fetch_begin(&stats->tx_syncp);
start = u64_stats_fetch_begin_bh(&stats->tx_syncp);
tpackets = stats->tx_packets;
tbytes = stats->tx_bytes;
} while (u64_stats_fetch_retry(&stats->tx_syncp, start));
} while (u64_stats_fetch_retry_bh(&stats->tx_syncp, start));

do {
start = u64_stats_fetch_begin(&stats->rx_syncp);
start = u64_stats_fetch_begin_bh(&stats->rx_syncp);
rpackets = stats->rx_packets;
rbytes = stats->rx_bytes;
} while (u64_stats_fetch_retry(&stats->rx_syncp, start));
} while (u64_stats_fetch_retry_bh(&stats->rx_syncp, start));

tot->rx_packets += rpackets;
tot->tx_packets += tpackets;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wimax/i2400m/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ ssize_t i2400m_tlv_match(const struct i2400m_tlv_hdr *tlv,
&& le16_to_cpu(tlv->length) + sizeof(*tlv) != tlv_size) {
size_t size = le16_to_cpu(tlv->length) + sizeof(*tlv);
printk(KERN_WARNING "W: tlv type 0x%x mismatched because of "
"size (got %zu vs %zu expected)\n",
"size (got %zu vs %zd expected)\n",
tlv_type, size, tlv_size);
return size;
}
Expand Down Expand Up @@ -235,7 +235,7 @@ const struct i2400m_tlv_hdr *i2400m_tlv_find(
break;
if (match > 0)
dev_warn(dev, "TLV type 0x%04x found with size "
"mismatch (%zu vs %zu needed)\n",
"mismatch (%zu vs %zd needed)\n",
tlv_type, match, tlv_size);
}
return tlv;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wimax/i2400m/usb-fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ ssize_t i2400mu_bus_bm_cmd_send(struct i2400m *i2400m,
}
if (result != cmd_size) { /* all was transferred? */
dev_err(dev, "boot-mode cmd %d: incomplete transfer "
"(%zu vs %zu submitted)\n", opcode, result, cmd_size);
"(%zd vs %zu submitted)\n", opcode, result, cmd_size);
result = -EIO;
goto error_cmd_size;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/vhost/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,14 +823,14 @@ static long vhost_net_ioctl(struct file *f, unsigned int ioctl,
return -EFAULT;
return vhost_net_set_backend(n, backend.index, backend.fd);
case VHOST_GET_FEATURES:
features = VHOST_FEATURES;
features = VHOST_NET_FEATURES;
if (copy_to_user(featurep, &features, sizeof features))
return -EFAULT;
return 0;
case VHOST_SET_FEATURES:
if (copy_from_user(&features, featurep, sizeof features))
return -EFAULT;
if (features & ~VHOST_FEATURES)
if (features & ~VHOST_NET_FEATURES)
return -EOPNOTSUPP;
return vhost_net_set_features(n, features);
case VHOST_RESET_OWNER:
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/vhost/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,14 @@ static long vhost_test_ioctl(struct file *f, unsigned int ioctl,
return -EFAULT;
return vhost_test_run(n, test);
case VHOST_GET_FEATURES:
features = VHOST_FEATURES;
features = VHOST_NET_FEATURES;
if (copy_to_user(featurep, &features, sizeof features))
return -EFAULT;
return 0;
case VHOST_SET_FEATURES:
if (copy_from_user(&features, featurep, sizeof features))
return -EFAULT;
if (features & ~VHOST_FEATURES)
if (features & ~VHOST_NET_FEATURES)
return -EOPNOTSUPP;
return vhost_test_set_features(n, features);
case VHOST_RESET_OWNER:
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/vhost/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static int vhost_poll_wakeup(wait_queue_t *wait, unsigned mode, int sync,
return 0;
}

static void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn)
void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn)
{
INIT_LIST_HEAD(&work->node);
work->fn = fn;
Expand Down Expand Up @@ -137,8 +137,7 @@ void vhost_poll_flush(struct vhost_poll *poll)
vhost_work_flush(poll->dev, &poll->work);
}

static inline void vhost_work_queue(struct vhost_dev *dev,
struct vhost_work *work)
void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work)
{
unsigned long flags;

Expand Down
6 changes: 5 additions & 1 deletion trunk/drivers/vhost/vhost.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ struct vhost_poll {
struct vhost_dev *dev;
};

void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn);
void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work);

void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn,
unsigned long mask, struct vhost_dev *dev);
void vhost_poll_start(struct vhost_poll *poll, struct file *file);
Expand Down Expand Up @@ -201,7 +204,8 @@ enum {
VHOST_FEATURES = (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) |
(1ULL << VIRTIO_RING_F_INDIRECT_DESC) |
(1ULL << VIRTIO_RING_F_EVENT_IDX) |
(1ULL << VHOST_F_LOG_ALL) |
(1ULL << VHOST_F_LOG_ALL),
VHOST_NET_FEATURES = VHOST_FEATURES |
(1ULL << VHOST_NET_F_VIRTIO_NET_HDR) |
(1ULL << VIRTIO_NET_F_MRG_RXBUF),
};
Expand Down
1 change: 1 addition & 0 deletions trunk/include/net/sctp/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ typedef enum {
typedef enum {
SCTP_TRANSPORT_UP,
SCTP_TRANSPORT_DOWN,
SCTP_TRANSPORT_PF,
} sctp_transport_cmd_t;

/* These are the address scopes defined mainly for IPv4 addresses
Expand Down
20 changes: 19 additions & 1 deletion trunk/include/net/sctp/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ extern struct sctp_globals {
int max_retrans_path;
int max_retrans_init;

/* Potentially-Failed.Max.Retrans sysctl value
* taken from:
* http://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-05
*/
int pf_retrans;

/*
* Policy for preforming sctp/socket accounting
* 0 - do socket level accounting, all assocs share sk_sndbuf
Expand Down Expand Up @@ -258,6 +264,7 @@ extern struct sctp_globals {
#define sctp_sndbuf_policy (sctp_globals.sndbuf_policy)
#define sctp_rcvbuf_policy (sctp_globals.rcvbuf_policy)
#define sctp_max_retrans_path (sctp_globals.max_retrans_path)
#define sctp_pf_retrans (sctp_globals.pf_retrans)
#define sctp_max_retrans_init (sctp_globals.max_retrans_init)
#define sctp_sack_timeout (sctp_globals.sack_timeout)
#define sctp_hb_interval (sctp_globals.hb_interval)
Expand Down Expand Up @@ -990,10 +997,15 @@ struct sctp_transport {

/* This is the max_retrans value for the transport and will
* be initialized from the assocs value. This can be changed
* using SCTP_SET_PEER_ADDR_PARAMS socket option.
* using the SCTP_SET_PEER_ADDR_PARAMS socket option.
*/
__u16 pathmaxrxt;

/* This is the partially failed retrans value for the transport
* and will be initialized from the assocs value. This can be changed
* using the SCTP_PEER_ADDR_THLDS socket option
*/
int pf_retrans;
/* PMTU : The current known path MTU. */
__u32 pathmtu;

Expand Down Expand Up @@ -1664,6 +1676,12 @@ struct sctp_association {
*/
int max_retrans;

/* This is the partially failed retrans value for the transport
* and will be initialized from the assocs value. This can be
* changed using the SCTP_PEER_ADDR_THLDS socket option
*/
int pf_retrans;

/* Maximum number of times the endpoint will retransmit INIT */
__u16 max_init_attempts;

Expand Down
11 changes: 11 additions & 0 deletions trunk/include/net/sctp/user.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ typedef __s32 sctp_assoc_t;
#define SCTP_GET_ASSOC_NUMBER 28 /* Read only */
#define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */
#define SCTP_AUTO_ASCONF 30
#define SCTP_PEER_ADDR_THLDS 31

/* Internal Socket Options. Some of the sctp library functions are
* implemented using these socket options.
Expand Down Expand Up @@ -649,6 +650,7 @@ struct sctp_paddrinfo {
*/
enum sctp_spinfo_state {
SCTP_INACTIVE,
SCTP_PF,
SCTP_ACTIVE,
SCTP_UNCONFIRMED,
SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */
Expand Down Expand Up @@ -741,4 +743,13 @@ typedef struct {
int sd;
} sctp_peeloff_arg_t;

/*
* Peer Address Thresholds socket option
*/
struct sctp_paddrthlds {
sctp_assoc_t spt_assoc_id;
struct sockaddr_storage spt_address;
__u16 spt_pathmaxrxt;
__u16 spt_pathpfthld;
};
#endif /* __net_sctp_user_h__ */
4 changes: 2 additions & 2 deletions trunk/net/bridge/br_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ static struct rtnl_link_stats64 *br_get_stats64(struct net_device *dev,
const struct br_cpu_netstats *bstats
= per_cpu_ptr(br->stats, cpu);
do {
start = u64_stats_fetch_begin(&bstats->syncp);
start = u64_stats_fetch_begin_bh(&bstats->syncp);
memcpy(&tmp, bstats, sizeof(tmp));
} while (u64_stats_fetch_retry(&bstats->syncp, start));
} while (u64_stats_fetch_retry_bh(&bstats->syncp, start));
sum.tx_bytes += tmp.tx_bytes;
sum.tx_packets += tmp.tx_packets;
sum.rx_bytes += tmp.rx_bytes;
Expand Down
3 changes: 2 additions & 1 deletion trunk/net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,8 @@ static DEFINE_PER_CPU(struct inet_sock, unicast_sock) = {
.sk_allocation = GFP_ATOMIC,
.sk_flags = (1UL << SOCK_USE_WRITE_QUEUE),
},
.pmtudisc = IP_PMTUDISC_WANT,
.pmtudisc = IP_PMTUDISC_WANT,
.uc_ttl = -1,
};

void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
Expand Down
37 changes: 30 additions & 7 deletions trunk/net/sctp/associola.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
* socket values.
*/
asoc->max_retrans = sp->assocparams.sasoc_asocmaxrxt;
asoc->pf_retrans = sctp_pf_retrans;

asoc->rto_initial = msecs_to_jiffies(sp->rtoinfo.srto_initial);
asoc->rto_max = msecs_to_jiffies(sp->rtoinfo.srto_max);
asoc->rto_min = msecs_to_jiffies(sp->rtoinfo.srto_min);
Expand Down Expand Up @@ -686,6 +688,9 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
/* Set the path max_retrans. */
peer->pathmaxrxt = asoc->pathmaxrxt;

/* And the partial failure retrnas threshold */
peer->pf_retrans = asoc->pf_retrans;

/* Initialize the peer's SACK delay timeout based on the
* association configured value.
*/
Expand Down Expand Up @@ -841,6 +846,7 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
struct sctp_ulpevent *event;
struct sockaddr_storage addr;
int spc_state = 0;
bool ulp_notify = true;

/* Record the transition on the transport. */
switch (command) {
Expand All @@ -854,6 +860,14 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
spc_state = SCTP_ADDR_CONFIRMED;
else
spc_state = SCTP_ADDR_AVAILABLE;
/* Don't inform ULP about transition from PF to
* active state and set cwnd to 1, see SCTP
* Quick failover draft section 5.1, point 5
*/
if (transport->state == SCTP_PF) {
ulp_notify = false;
transport->cwnd = 1;
}
transport->state = SCTP_ACTIVE;
break;

Expand All @@ -872,19 +886,27 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
spc_state = SCTP_ADDR_UNREACHABLE;
break;

case SCTP_TRANSPORT_PF:
transport->state = SCTP_PF;
ulp_notify = false;
break;

default:
return;
}

/* Generate and send a SCTP_PEER_ADDR_CHANGE notification to the
* user.
*/
memset(&addr, 0, sizeof(struct sockaddr_storage));
memcpy(&addr, &transport->ipaddr, transport->af_specific->sockaddr_len);
event = sctp_ulpevent_make_peer_addr_change(asoc, &addr,
0, spc_state, error, GFP_ATOMIC);
if (event)
sctp_ulpq_tail_event(&asoc->ulpq, event);
if (ulp_notify) {
memset(&addr, 0, sizeof(struct sockaddr_storage));
memcpy(&addr, &transport->ipaddr,
transport->af_specific->sockaddr_len);
event = sctp_ulpevent_make_peer_addr_change(asoc, &addr,
0, spc_state, error, GFP_ATOMIC);
if (event)
sctp_ulpq_tail_event(&asoc->ulpq, event);
}

/* Select new active and retran paths. */

Expand All @@ -900,7 +922,8 @@ void sctp_assoc_control_transport(struct sctp_association *asoc,
transports) {

if ((t->state == SCTP_INACTIVE) ||
(t->state == SCTP_UNCONFIRMED))
(t->state == SCTP_UNCONFIRMED) ||
(t->state == SCTP_PF))
continue;
if (!first || t->last_time_heard > first->last_time_heard) {
second = first;
Expand Down
Loading

0 comments on commit 5a6103a

Please sign in to comment.