* RE: [PATCH 2/3] bna: Remove unnecessary memset(,0,)
From: Rasesh Mody @ 2011-01-12 22:55 UTC (permalink / raw)
To: Joe Perches, Debashis Dutt
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <0ed96bd1a053e61c827f2ac09e38cba59e32a21b.1294867098.git.joe@perches.com>
>From: Joe Perches [mailto:joe@perches.com]
>Sent: Wednesday, January 12, 2011 1:21 PM
>
>kzalloc'd memory doesn't need a memset to 0.
>
>Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Rasesh Mody <rmody@brocade.com>
>---
> drivers/net/bna/bnad_ethtool.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
>diff --git a/drivers/net/bna/bnad_ethtool.c
>b/drivers/net/bna/bnad_ethtool.c
>index 99be5ae..142d604 100644
>--- a/drivers/net/bna/bnad_ethtool.c
>+++ b/drivers/net/bna/bnad_ethtool.c
>@@ -275,7 +275,6 @@ bnad_get_drvinfo(struct net_device *netdev, struct
>ethtool_drvinfo *drvinfo)
>
> ioc_attr = kzalloc(sizeof(*ioc_attr), GFP_KERNEL);
> if (ioc_attr) {
>- memset(ioc_attr, 0, sizeof(*ioc_attr));
> spin_lock_irqsave(&bnad->bna_lock, flags);
> bfa_nw_ioc_get_attr(&bnad->bna.device.ioc, ioc_attr);
> spin_unlock_irqrestore(&bnad->bna_lock, flags);
>--
>1.7.3.3.398.g0b0cd.dirty
Joe,
Patch looks ok to me.
Thanks,
Rasesh
^ permalink raw reply
* Re: [PATCH] net: remove dev_txq_stats_fold()
From: Eric Dumazet @ 2011-01-12 22:13 UTC (permalink / raw)
To: Jarek Poplawski
Cc: David Miller, David Brownell, Neil Jones, linux-usb, netdev,
Alexander Duyck, Jeff Kirsher, Michal Nazarewicz,
Sandeep Gopalpet
In-Reply-To: <20110112211806.GB2152@del.dom.local>
Le mercredi 12 janvier 2011 à 22:18 +0100, Jarek Poplawski a écrit :
> Btw, I updated Michal's email (according to linux-kernel).
>
> Jarek P.
>
> On Wed, Jan 12, 2011 at 10:05:18PM +0100, Jarek Poplawski wrote:
> > On Wed, Jan 12, 2011 at 04:02:00PM +0100, Eric Dumazet wrote:
> > > Le mercredi 12 janvier 2011 ?? 14:52 +0100, Eric Dumazet a écrit :
> > >
> > > > Or even better, remove these counters since there is no users left but
> > > > ixgbe.
> > > >
> > > > (vlans, tunnels, ... now use percpu stats)
> > > >
> > > >
> > >
> > > Thanks Jarek for the reminder :)
> > >
> > > [PATCH] net: remove dev_txq_stats_fold()
> > >
> > > After recent changes, (percpu stats on vlan/tunnels...), we dont need
> > > anymore per struct netdev_queue tx_bytes/tx_packets/tx_dropped counters.
> > >
> > > Only remaining users are ixgbe, sch_teql & macvlan :
> >
> > And gianfar (not counting staging/bcm) but I'm not sure if that's all.
> >
Hmm, I did a "allyesconfig", but on x86_64 ;)
> > >
> > > 1) ixgbe can be converted to use existing tx_ring counters.
> > >
> > > 2) macvlan incremented txq->tx_dropped, it can use the
> > > dev->stats.tx_dropped counter.
> > >
> > > 3) sch_teql : almost revert ab35cd4b8f42 (Use net_device internal stats)
> > > Now we have ndo_get_stats64(), use it.
> >
> > Btw, why doesn't sch_teql need locking (for 32-bits)?
Yes you're right, thanks !
[PATCH v2] net: remove dev_txq_stats_fold()
After recent changes, (percpu stats on vlan/tunnels...), we dont need
anymore per struct netdev_queue tx_bytes/tx_packets/tx_dropped counters.
Only remaining users are ixgbe, sch_teql, gianfar & macvlan :
1) ixgbe can be converted to use existing tx_ring counters.
2) macvlan incremented txq->tx_dropped, it can use the
dev->stats.tx_dropped counter.
3) sch_teql : almost revert ab35cd4b8f42 (Use net_device internal stats)
Now we have ndo_get_stats64(), use it, even for "unsigned long"
fields (No need to bring back a struct net_device_stats)
4) gianfar adds a stats structure per tx queue to hold
tx_bytes/tx_packets
This removes a lockdep warning (and possible lockup) in rndis gadget,
calling dev_get_stats() from hard IRQ context.
Ref: http://www.spinics.net/lists/netdev/msg149202.html
Reported-by: Neil Jones <neiljay@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Jarek Poplawski <jarkao2@gmail.com>
CC: Alexander Duyck <alexander.h.duyck@intel.com>
CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
CC: Sandeep Gopalpet <sandeep.kumar@freescale.com>
CC: Michal Nazarewicz <mina86@mina86.com>
---
v2: added gianfar, removed u64 fields from sch_teql to avoid extra
locking
drivers/net/gianfar.c | 10 ++++------
drivers/net/gianfar.h | 10 ++++++++++
drivers/net/ixgbe/ixgbe_main.c | 23 ++++++++++++++++-------
drivers/net/macvtap.c | 2 +-
include/linux/netdevice.h | 5 -----
net/core/dev.c | 29 -----------------------------
net/sched/sch_teql.c | 26 +++++++++++++++++++++-----
7 files changed, 52 insertions(+), 53 deletions(-)
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 6de4675..119aa20 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -434,7 +434,6 @@ static void gfar_init_mac(struct net_device *ndev)
static struct net_device_stats *gfar_get_stats(struct net_device *dev)
{
struct gfar_private *priv = netdev_priv(dev);
- struct netdev_queue *txq;
unsigned long rx_packets = 0, rx_bytes = 0, rx_dropped = 0;
unsigned long tx_packets = 0, tx_bytes = 0;
int i = 0;
@@ -450,9 +449,8 @@ static struct net_device_stats *gfar_get_stats(struct net_device *dev)
dev->stats.rx_dropped = rx_dropped;
for (i = 0; i < priv->num_tx_queues; i++) {
- txq = netdev_get_tx_queue(dev, i);
- tx_bytes += txq->tx_bytes;
- tx_packets += txq->tx_packets;
+ tx_bytes += priv->tx_queue[i]->stats.tx_bytes;
+ tx_packets += priv->tx_queue[i]->stats.tx_packets;
}
dev->stats.tx_bytes = tx_bytes;
@@ -2109,8 +2107,8 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
/* Update transmit stats */
- txq->tx_bytes += skb->len;
- txq->tx_packets ++;
+ tx_queue->stats.tx_bytes += skb->len;
+ tx_queue->stats.tx_packets++;
txbdp = txbdp_start = tx_queue->cur_tx;
lstatus = txbdp->lstatus;
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 68984eb..54de413 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -907,12 +907,21 @@ enum {
MQ_MG_MODE
};
+/*
+ * Per TX queue stats
+ */
+struct tx_q_stats {
+ unsigned long tx_packets;
+ unsigned long tx_bytes;
+};
+
/**
* struct gfar_priv_tx_q - per tx queue structure
* @txlock: per queue tx spin lock
* @tx_skbuff:skb pointers
* @skb_curtx: to be used skb pointer
* @skb_dirtytx:the last used skb pointer
+ * @stats: bytes/packets stats
* @qindex: index of this queue
* @dev: back pointer to the dev structure
* @grp: back pointer to the group to which this queue belongs
@@ -934,6 +943,7 @@ struct gfar_priv_tx_q {
struct txbd8 *tx_bd_base;
struct txbd8 *cur_tx;
struct txbd8 *dirty_tx;
+ struct tx_q_stats stats;
struct net_device *dev;
struct gfar_priv_grp *grp;
u16 skb_curtx;
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index a060610..602078b 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -6667,8 +6667,6 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
struct ixgbe_adapter *adapter,
struct ixgbe_ring *tx_ring)
{
- struct net_device *netdev = tx_ring->netdev;
- struct netdev_queue *txq;
unsigned int first;
unsigned int tx_flags = 0;
u8 hdr_len = 0;
@@ -6765,9 +6763,6 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
/* add the ATR filter if ATR is on */
if (test_bit(__IXGBE_TX_FDIR_INIT_DONE, &tx_ring->state))
ixgbe_atr(tx_ring, skb, tx_flags, protocol);
- txq = netdev_get_tx_queue(netdev, tx_ring->queue_index);
- txq->tx_bytes += skb->len;
- txq->tx_packets++;
ixgbe_tx_queue(tx_ring, tx_flags, count, skb->len, hdr_len);
ixgbe_maybe_stop_tx(tx_ring, DESC_NEEDED);
@@ -6925,8 +6920,6 @@ static struct rtnl_link_stats64 *ixgbe_get_stats64(struct net_device *netdev,
struct ixgbe_adapter *adapter = netdev_priv(netdev);
int i;
- /* accurate rx/tx bytes/packets stats */
- dev_txq_stats_fold(netdev, stats);
rcu_read_lock();
for (i = 0; i < adapter->num_rx_queues; i++) {
struct ixgbe_ring *ring = ACCESS_ONCE(adapter->rx_ring[i]);
@@ -6943,6 +6936,22 @@ static struct rtnl_link_stats64 *ixgbe_get_stats64(struct net_device *netdev,
stats->rx_bytes += bytes;
}
}
+
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+ struct ixgbe_ring *ring = ACCESS_ONCE(adapter->tx_ring[i]);
+ u64 bytes, packets;
+ unsigned int start;
+
+ if (ring) {
+ do {
+ start = u64_stats_fetch_begin_bh(&ring->syncp);
+ packets = ring->stats.packets;
+ bytes = ring->stats.bytes;
+ } while (u64_stats_fetch_retry_bh(&ring->syncp, start));
+ stats->tx_packets += packets;
+ stats->tx_bytes += bytes;
+ }
+ }
rcu_read_unlock();
/* following stats updated by ixgbe_watchdog_task() */
stats->multicast = netdev->stats.multicast;
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 21845af..5933621 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -585,7 +585,7 @@ err:
rcu_read_lock_bh();
vlan = rcu_dereference(q->vlan);
if (vlan)
- netdev_get_tx_queue(vlan->dev, 0)->tx_dropped++;
+ vlan->dev->stats.tx_dropped++;
rcu_read_unlock_bh();
return err;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index be4957c..d971346 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -520,9 +520,6 @@ struct netdev_queue {
* please use this field instead of dev->trans_start
*/
unsigned long trans_start;
- u64 tx_bytes;
- u64 tx_packets;
- u64 tx_dropped;
} ____cacheline_aligned_in_smp;
static inline int netdev_queue_numa_node_read(const struct netdev_queue *q)
@@ -2265,8 +2262,6 @@ extern void dev_load(struct net *net, const char *name);
extern void dev_mcast_init(void);
extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
struct rtnl_link_stats64 *storage);
-extern void dev_txq_stats_fold(const struct net_device *dev,
- struct rtnl_link_stats64 *stats);
extern int netdev_max_backlog;
extern int netdev_tstamp_prequeue;
diff --git a/net/core/dev.c b/net/core/dev.c
index a3ef808..83507c2 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5523,34 +5523,6 @@ void netdev_run_todo(void)
}
}
-/**
- * dev_txq_stats_fold - fold tx_queues stats
- * @dev: device to get statistics from
- * @stats: struct rtnl_link_stats64 to hold results
- */
-void dev_txq_stats_fold(const struct net_device *dev,
- struct rtnl_link_stats64 *stats)
-{
- u64 tx_bytes = 0, tx_packets = 0, tx_dropped = 0;
- unsigned int i;
- struct netdev_queue *txq;
-
- for (i = 0; i < dev->num_tx_queues; i++) {
- txq = netdev_get_tx_queue(dev, i);
- spin_lock_bh(&txq->_xmit_lock);
- tx_bytes += txq->tx_bytes;
- tx_packets += txq->tx_packets;
- tx_dropped += txq->tx_dropped;
- spin_unlock_bh(&txq->_xmit_lock);
- }
- if (tx_bytes || tx_packets || tx_dropped) {
- stats->tx_bytes = tx_bytes;
- stats->tx_packets = tx_packets;
- stats->tx_dropped = tx_dropped;
- }
-}
-EXPORT_SYMBOL(dev_txq_stats_fold);
-
/* Convert net_device_stats to rtnl_link_stats64. They have the same
* fields in the same order, with only the type differing.
*/
@@ -5594,7 +5566,6 @@ struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev,
netdev_stats_to_stats64(storage, ops->ndo_get_stats(dev));
} else {
netdev_stats_to_stats64(storage, &dev->stats);
- dev_txq_stats_fold(dev, storage);
}
storage->rx_dropped += atomic_long_read(&dev->rx_dropped);
return storage;
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c
index af9360d..8ab66a4 100644
--- a/net/sched/sch_teql.c
+++ b/net/sched/sch_teql.c
@@ -59,6 +59,10 @@ struct teql_master
struct net_device *dev;
struct Qdisc *slaves;
struct list_head master_list;
+ unsigned long tx_bytes;
+ unsigned long tx_packets;
+ unsigned long tx_errors;
+ unsigned long tx_dropped;
};
struct teql_sched_data
@@ -274,7 +278,6 @@ static inline int teql_resolve(struct sk_buff *skb,
static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct teql_master *master = netdev_priv(dev);
- struct netdev_queue *txq = netdev_get_tx_queue(dev, 0);
struct Qdisc *start, *q;
int busy;
int nores;
@@ -314,8 +317,8 @@ restart:
__netif_tx_unlock(slave_txq);
master->slaves = NEXT_SLAVE(q);
netif_wake_queue(dev);
- txq->tx_packets++;
- txq->tx_bytes += length;
+ master->tx_packets++;
+ master->tx_bytes += length;
return NETDEV_TX_OK;
}
__netif_tx_unlock(slave_txq);
@@ -342,10 +345,10 @@ restart:
netif_stop_queue(dev);
return NETDEV_TX_BUSY;
}
- dev->stats.tx_errors++;
+ master->tx_errors++;
drop:
- txq->tx_dropped++;
+ master->tx_dropped++;
dev_kfree_skb(skb);
return NETDEV_TX_OK;
}
@@ -398,6 +401,18 @@ static int teql_master_close(struct net_device *dev)
return 0;
}
+static struct rtnl_link_stats64 *teql_master_stats64(struct net_device *dev,
+ struct rtnl_link_stats64 *stats)
+{
+ struct teql_master *m = netdev_priv(dev);
+
+ stats->tx_packets = m->tx_packets;
+ stats->tx_bytes = m->tx_bytes;
+ stats->tx_errors = m->tx_errors;
+ stats->tx_dropped = m->tx_dropped;
+ return stats;
+}
+
static int teql_master_mtu(struct net_device *dev, int new_mtu)
{
struct teql_master *m = netdev_priv(dev);
@@ -422,6 +437,7 @@ static const struct net_device_ops teql_netdev_ops = {
.ndo_open = teql_master_open,
.ndo_stop = teql_master_close,
.ndo_start_xmit = teql_master_xmit,
+ .ndo_get_stats64 = teql_master_stats64,
.ndo_change_mtu = teql_master_mtu,
};
^ permalink raw reply related
* [PATCH 2/3] bna: Remove unnecessary memset(,0,)
From: Joe Perches @ 2011-01-12 21:21 UTC (permalink / raw)
To: Rasesh Mody, Debashis Dutt; +Cc: netdev, linux-kernel
In-Reply-To: <6f6d4a7a705949a3464471f364f77215f1e796f3.1294867098.git.joe@perches.com>
kzalloc'd memory doesn't need a memset to 0.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/bna/bnad_ethtool.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/net/bna/bnad_ethtool.c b/drivers/net/bna/bnad_ethtool.c
index 99be5ae..142d604 100644
--- a/drivers/net/bna/bnad_ethtool.c
+++ b/drivers/net/bna/bnad_ethtool.c
@@ -275,7 +275,6 @@ bnad_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
ioc_attr = kzalloc(sizeof(*ioc_attr), GFP_KERNEL);
if (ioc_attr) {
- memset(ioc_attr, 0, sizeof(*ioc_attr));
spin_lock_irqsave(&bnad->bna_lock, flags);
bfa_nw_ioc_get_attr(&bnad->bna.device.ioc, ioc_attr);
spin_unlock_irqrestore(&bnad->bna_lock, flags);
--
1.7.3.3.398.g0b0cd.dirty
^ permalink raw reply related
* Re: TCP connections stall when station re-associates.
From: Ben Greear @ 2011-01-12 21:19 UTC (permalink / raw)
To: NetDev, linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <4D2CFDB8.3010907-my8/4N5VtI7c+919tysfdA@public.gmane.org>
On 01/11/2011 05:02 PM, Ben Greear wrote:
>
> We're seeing something funny while testing ath9k and ath5k with
> multiple VIFs. We are using send-to-self routing rules
> and have a TCP connection going between two station interfaces
> connected to the same AP. Kernel is ~2.6.37 (wireless-testing from
> a few days ago, plus some local patches). We tried commercial
> APs and ath9k/ath5k APs running 2.6.37 kernel and hostap with
> similar results.
When the stations re-connect, we re-run dhcp client, which involves
setting IP to zero and then re-acquiring the IP address. We
then set up new routing rules, etc to have it back to the way
it was before the station lost contact with the AP.
The TCP/IP connections are specifically bound to local IP and port.
Maybe it is invalid to expect TCP connections to survive this
IP change?
I'll work on reproducing this DHCP behaviour on some regular
wired interfaces and see if I can reproduce in a simpler test
case.
Thanks,
Ben
--
Ben Greear <greearb-my8/4N5VtI7c+919tysfdA@public.gmane.org>
Candela Technologies Inc http://www.candelatech.com
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] net: remove dev_txq_stats_fold()
From: Jarek Poplawski @ 2011-01-12 21:18 UTC (permalink / raw)
To: Eric Dumazet
Cc: David Miller, David Brownell, Neil Jones,
linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
Alexander Duyck, Jeff Kirsher, Michal Nazarewicz
In-Reply-To: <20110112210518.GA2152-qLhEM4ewh5CNj9Bq2fkWzw@public.gmane.org>
Btw, I updated Michal's email (according to linux-kernel).
Jarek P.
On Wed, Jan 12, 2011 at 10:05:18PM +0100, Jarek Poplawski wrote:
> On Wed, Jan 12, 2011 at 04:02:00PM +0100, Eric Dumazet wrote:
> > Le mercredi 12 janvier 2011 ?? 14:52 +0100, Eric Dumazet a écrit :
> >
> > > Or even better, remove these counters since there is no users left but
> > > ixgbe.
> > >
> > > (vlans, tunnels, ... now use percpu stats)
> > >
> > >
> >
> > Thanks Jarek for the reminder :)
> >
> > [PATCH] net: remove dev_txq_stats_fold()
> >
> > After recent changes, (percpu stats on vlan/tunnels...), we dont need
> > anymore per struct netdev_queue tx_bytes/tx_packets/tx_dropped counters.
> >
> > Only remaining users are ixgbe, sch_teql & macvlan :
>
> And gianfar (not counting staging/bcm) but I'm not sure if that's all.
>
> >
> > 1) ixgbe can be converted to use existing tx_ring counters.
> >
> > 2) macvlan incremented txq->tx_dropped, it can use the
> > dev->stats.tx_dropped counter.
> >
> > 3) sch_teql : almost revert ab35cd4b8f42 (Use net_device internal stats)
> > Now we have ndo_get_stats64(), use it.
>
> Btw, why doesn't sch_teql need locking (for 32-bits)?
>
> Jarek P.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next] netfilter: x_table: speedup compat operations
From: Eric Dumazet @ 2011-01-12 21:14 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: Patrick McHardy, David Miller, Netfilter Development Mailinglist,
netdev
In-Reply-To: <4D2E18E5.4000902@netfilter.org>
Le mercredi 12 janvier 2011 à 22:11 +0100, Pablo Neira Ayuso a écrit :
> On 12/01/11 22:03, Eric Dumazet wrote:
> > Le mercredi 12 janvier 2011 à 21:44 +0100, Pablo Neira Ayuso a écrit :
> >
> >> minor glitch: We leak xp->compat_tab if this error condition above is true.
> >>
> >
> > I dont think so, pointer is stored in xp->compat_tab
> >
> > xt_compat_flush_offsets() will free it.
>
> Indeed, sorry. I'm going apply your patch. Thanks Eric.
Thanks ! I completely forgot about it, to be honest :)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next] netfilter: x_table: speedup compat operations
From: Pablo Neira Ayuso @ 2011-01-12 21:11 UTC (permalink / raw)
To: Eric Dumazet
Cc: Patrick McHardy, David Miller, Netfilter Development Mailinglist,
netdev
In-Reply-To: <1294866229.3335.2.camel@edumazet-laptop>
On 12/01/11 22:03, Eric Dumazet wrote:
> Le mercredi 12 janvier 2011 à 21:44 +0100, Pablo Neira Ayuso a écrit :
>
>> minor glitch: We leak xp->compat_tab if this error condition above is true.
>>
>
> I dont think so, pointer is stored in xp->compat_tab
>
> xt_compat_flush_offsets() will free it.
Indeed, sorry. I'm going apply your patch. Thanks Eric.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: XT_MATCH_REALM Kconfig whinge...
From: Pablo Neira Ayuso @ 2011-01-12 21:08 UTC (permalink / raw)
To: Jan Engelhardt
Cc: Valdis.Kletnieks, Patrick McHardy, David S. Miller, linux-kernel,
netfilter-devel, netdev
In-Reply-To: <alpine.LNX.2.01.1101122156310.27393@obet.zrqbmnf.qr>
[-- Attachment #1: Type: text/plain, Size: 1236 bytes --]
On 12/01/11 21:57, Jan Engelhardt wrote:
> On Wednesday 2011-01-12 20:48, Pablo Neira Ayuso wrote:
>
>> On 12/01/11 20:15, Valdis.Kletnieks@vt.edu wrote:
>>> scripts/kconfig/conf --silentoldconfig Kconfig
>>> warning: (NETFILTER_XT_MATCH_REALM) selects NET_CLS_ROUTE which has unmet direct dependencies (NET && NET_SCHED)
>>> warning: (NETFILTER_XT_MATCH_REALM) selects NET_CLS_ROUTE which has unmet direct dependencies (NET && NET_SCHED)
>>
>> Does this fix your problem?
>>
>
> diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
> index 1534f2b..ae56764 100644
> --- a/net/netfilter/Kconfig
> +++ b/net/netfilter/Kconfig
> @@ -886,7 +886,8 @@ config NETFILTER_XT_MATCH_RATEEST
> config NETFILTER_XT_MATCH_REALM
> tristate '"realm" match support'
> depends on NETFILTER_ADVANCED
> - select NET_CLS_ROUTE
> + depends on NET_SCHED
> + depends on NET_CLS_ROUTE
> help
> This option adds a `realm' match, which allows you to use the realm
> key from the routing subsystem inside iptables.
>
>
> This patch is not right. The select should just be removed, because
> xt_realm is useful even without SCHED and CLS_ROUTE.
I wonder why NET_CLS_ROUTE has been there as dependency.
Then this patch should be fine.
[-- Attachment #2: realm.patch --]
[-- Type: text/x-patch, Size: 1136 bytes --]
netfilter: xt_realm: fix unmet direct dependencies
From: Pablo Neira Ayuso <pablo@netfilter.org>
scripts/kconfig/conf --silentoldconfig Kconfig
warning: (NETFILTER_XT_MATCH_REALM) selects NET_CLS_ROUTE which has unmet direct dependencies (NET && NET_SCHED)
warning: (NETFILTER_XT_MATCH_REALM) selects NET_CLS_ROUTE which has unmet direct dependencies (NET && NET_SCHED)
Jan Engelhardt spotted that NET_CLS_ROUTE is a superfluous dependency,
for that reason, this patch remove it.
Reported by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/Kconfig | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index 1534f2b..8960260 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -886,7 +886,6 @@ config NETFILTER_XT_MATCH_RATEEST
config NETFILTER_XT_MATCH_REALM
tristate '"realm" match support'
depends on NETFILTER_ADVANCED
- select NET_CLS_ROUTE
help
This option adds a `realm' match, which allows you to use the realm
key from the routing subsystem inside iptables.
^ permalink raw reply related
* Re: [PATCH] net: remove dev_txq_stats_fold()
From: Jarek Poplawski @ 2011-01-12 21:05 UTC (permalink / raw)
To: Eric Dumazet
Cc: David Miller, David Brownell, Michał Nazarewicz, Neil Jones,
linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
Alexander Duyck, Jeff Kirsher
In-Reply-To: <1294844520.3981.84.camel@edumazet-laptop>
On Wed, Jan 12, 2011 at 04:02:00PM +0100, Eric Dumazet wrote:
> Le mercredi 12 janvier 2011 ?? 14:52 +0100, Eric Dumazet a écrit :
>
> > Or even better, remove these counters since there is no users left but
> > ixgbe.
> >
> > (vlans, tunnels, ... now use percpu stats)
> >
> >
>
> Thanks Jarek for the reminder :)
>
> [PATCH] net: remove dev_txq_stats_fold()
>
> After recent changes, (percpu stats on vlan/tunnels...), we dont need
> anymore per struct netdev_queue tx_bytes/tx_packets/tx_dropped counters.
>
> Only remaining users are ixgbe, sch_teql & macvlan :
And gianfar (not counting staging/bcm) but I'm not sure if that's all.
>
> 1) ixgbe can be converted to use existing tx_ring counters.
>
> 2) macvlan incremented txq->tx_dropped, it can use the
> dev->stats.tx_dropped counter.
>
> 3) sch_teql : almost revert ab35cd4b8f42 (Use net_device internal stats)
> Now we have ndo_get_stats64(), use it.
Btw, why doesn't sch_teql need locking (for 32-bits)?
Jarek P.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next] netfilter: x_table: speedup compat operations
From: Eric Dumazet @ 2011-01-12 21:03 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: Patrick McHardy, David Miller, Netfilter Development Mailinglist,
netdev
In-Reply-To: <4D2E12B9.6090201@netfilter.org>
Le mercredi 12 janvier 2011 à 21:44 +0100, Pablo Neira Ayuso a écrit :
> minor glitch: We leak xp->compat_tab if this error condition above is true.
>
I dont think so, pointer is stored in xp->compat_tab
xt_compat_flush_offsets() will free it.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: XT_MATCH_REALM Kconfig whinge...
From: Jan Engelhardt @ 2011-01-12 20:57 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: Valdis.Kletnieks, Patrick McHardy, David S. Miller, linux-kernel,
netfilter-devel, netdev
In-Reply-To: <4D2E057D.30707@netfilter.org>
On Wednesday 2011-01-12 20:48, Pablo Neira Ayuso wrote:
>On 12/01/11 20:15, Valdis.Kletnieks@vt.edu wrote:
>> scripts/kconfig/conf --silentoldconfig Kconfig
>> warning: (NETFILTER_XT_MATCH_REALM) selects NET_CLS_ROUTE which has unmet direct dependencies (NET && NET_SCHED)
>> warning: (NETFILTER_XT_MATCH_REALM) selects NET_CLS_ROUTE which has unmet direct dependencies (NET && NET_SCHED)
>
>Does this fix your problem?
>
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index 1534f2b..ae56764 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -886,7 +886,8 @@ config NETFILTER_XT_MATCH_RATEEST
config NETFILTER_XT_MATCH_REALM
tristate '"realm" match support'
depends on NETFILTER_ADVANCED
- select NET_CLS_ROUTE
+ depends on NET_SCHED
+ depends on NET_CLS_ROUTE
help
This option adds a `realm' match, which allows you to use the realm
key from the routing subsystem inside iptables.
This patch is not right. The select should just be removed, because
xt_realm is useful even without SCHED and CLS_ROUTE.
^ permalink raw reply related
* Re: [PATCH V8 02/13] ntp: add ADJ_SETOFFSET mode bit
From: john stultz @ 2011-01-12 20:55 UTC (permalink / raw)
To: Kuwahara,T.
Cc: Richard Cochran, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-api-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
Alan Cox, Arnd Bergmann, Christoph Lameter, David Miller,
Krzysztof Halasa, Peter Zijlstra, Rodolfo Giometti,
Thomas Gleixner
In-Reply-To: <AANLkTikYuYwb4BLsU3BF_=d9fAdcfb0AC2itDBeyFsNq-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Thu, 2011-01-13 at 05:39 +0900, Kuwahara,T. wrote:
> On Wed, Jan 12, 2011 at 5:55 AM, john stultz <johnstul-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> wrote:
> > So the kernel handles leap second insertion via a timer. Thus at the end
> > of 23:59:59, it will inject a leapsecond by setting the time back by one
> > second (back to 23:59:59) and setting the TIME_OOP flag.
> >
> > This timer is an absolute timer, so if someone moves the clock forward
> > across the 23:59:59 boundary, the adjustment will still be made.
> >
> > The patch is not broken, nor useless.
>
> It takes into account only one upcoming leap second, but ignores all
> the others. That's not sufficient for arbitrary adjustments.
If an application wants to manage the full historical table of
leapseconds and compensate appropriately, then that's fine. The
interface proposed still functions in a reasonable manner.
Again, I agree that leapseconds are annoying to deal with. It would be
great if time() was defined as TAI time instead of UTC. I'm actually
hoping to provide a CLOCK_TAI clockid someday.
thanks
-john
^ permalink raw reply
* Re: [PATCH net-next] netfilter: x_table: speedup compat operations
From: Pablo Neira Ayuso @ 2011-01-12 20:44 UTC (permalink / raw)
To: Eric Dumazet
Cc: Patrick McHardy, David Miller, Netfilter Development Mailinglist,
netdev
In-Reply-To: <1292693715.18869.148.camel@edumazet-laptop>
On 18/12/10 18:35, Eric Dumazet wrote:
> One iptables invocation with 135000 rules takes 35 seconds of cpu time
> on a recent server, using a 32bit distro and a 64bit kernel.
>
> We eventually trigger NMI/RCU watchdog.
>
> INFO: rcu_sched_state detected stall on CPU 3 (t=6000 jiffies)
>
> COMPAT mode has quadratic behavior and consume 16 bytes of memory per
> rule.
>
> Switch the xt_compat algos to use an array instead of list, and use a
> binary search to locate an offset in the sorted array.
>
> This halves memory need (8 bytes per rule), and removes quadratic
> behavior [ O(N*N) -> O(N*log2(N)) ]
>
> Time of iptables goes from 35 s to 150 ms.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
> include/linux/netfilter/x_tables.h | 3
> net/bridge/netfilter/ebtables.c | 1
> net/ipv4/netfilter/arp_tables.c | 2
> net/ipv4/netfilter/ip_tables.c | 2
> net/ipv6/netfilter/ip6_tables.c | 2
> net/netfilter/x_tables.c | 82 +++++++++++++++------------
> 6 files changed, 57 insertions(+), 35 deletions(-)
>
> diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
> index 742bec0..0f04d98 100644
> --- a/include/linux/netfilter/x_tables.h
> +++ b/include/linux/netfilter/x_tables.h
> @@ -611,8 +611,9 @@ struct _compat_xt_align {
> extern void xt_compat_lock(u_int8_t af);
> extern void xt_compat_unlock(u_int8_t af);
>
> -extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta);
> +extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, int delta);
> extern void xt_compat_flush_offsets(u_int8_t af);
> +extern void xt_compat_init_offsets(u_int8_t af, unsigned int number);
> extern int xt_compat_calc_jump(u_int8_t af, unsigned int offset);
>
> extern int xt_compat_match_offset(const struct xt_match *match);
> diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
> index cbc9f39..2bf2fb2 100644
> --- a/net/bridge/netfilter/ebtables.c
> +++ b/net/bridge/netfilter/ebtables.c
> @@ -1764,6 +1764,7 @@ static int compat_table_info(const struct ebt_table_info *info,
>
> newinfo->entries_size = size;
>
> + xt_compat_init_offsets(AF_INET, info->nentries);
> return EBT_ENTRY_ITERATE(entries, size, compat_calc_entry, info,
> entries, newinfo);
> }
> diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
> index 3fac340..47e5178 100644
> --- a/net/ipv4/netfilter/arp_tables.c
> +++ b/net/ipv4/netfilter/arp_tables.c
> @@ -883,6 +883,7 @@ static int compat_table_info(const struct xt_table_info *info,
> memcpy(newinfo, info, offsetof(struct xt_table_info, entries));
> newinfo->initial_entries = 0;
> loc_cpu_entry = info->entries[raw_smp_processor_id()];
> + xt_compat_init_offsets(NFPROTO_ARP, info->number);
> xt_entry_foreach(iter, loc_cpu_entry, info->size) {
> ret = compat_calc_entry(iter, info, loc_cpu_entry, newinfo);
> if (ret != 0)
> @@ -1350,6 +1351,7 @@ static int translate_compat_table(const char *name,
> duprintf("translate_compat_table: size %u\n", info->size);
> j = 0;
> xt_compat_lock(NFPROTO_ARP);
> + xt_compat_init_offsets(NFPROTO_ARP, number);
> /* Walk through entries, checking offsets. */
> xt_entry_foreach(iter0, entry0, total_size) {
> ret = check_compat_entry_size_and_hooks(iter0, info, &size,
> diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
> index a846d63..c5a75d7 100644
> --- a/net/ipv4/netfilter/ip_tables.c
> +++ b/net/ipv4/netfilter/ip_tables.c
> @@ -1080,6 +1080,7 @@ static int compat_table_info(const struct xt_table_info *info,
> memcpy(newinfo, info, offsetof(struct xt_table_info, entries));
> newinfo->initial_entries = 0;
> loc_cpu_entry = info->entries[raw_smp_processor_id()];
> + xt_compat_init_offsets(AF_INET, info->number);
> xt_entry_foreach(iter, loc_cpu_entry, info->size) {
> ret = compat_calc_entry(iter, info, loc_cpu_entry, newinfo);
> if (ret != 0)
> @@ -1681,6 +1682,7 @@ translate_compat_table(struct net *net,
> duprintf("translate_compat_table: size %u\n", info->size);
> j = 0;
> xt_compat_lock(AF_INET);
> + xt_compat_init_offsets(AF_INET, number);
> /* Walk through entries, checking offsets. */
> xt_entry_foreach(iter0, entry0, total_size) {
> ret = check_compat_entry_size_and_hooks(iter0, info, &size,
> diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
> index 4555823..0c9973a 100644
> --- a/net/ipv6/netfilter/ip6_tables.c
> +++ b/net/ipv6/netfilter/ip6_tables.c
> @@ -1093,6 +1093,7 @@ static int compat_table_info(const struct xt_table_info *info,
> memcpy(newinfo, info, offsetof(struct xt_table_info, entries));
> newinfo->initial_entries = 0;
> loc_cpu_entry = info->entries[raw_smp_processor_id()];
> + xt_compat_init_offsets(AF_INET6, info->number);
> xt_entry_foreach(iter, loc_cpu_entry, info->size) {
> ret = compat_calc_entry(iter, info, loc_cpu_entry, newinfo);
> if (ret != 0)
> @@ -1696,6 +1697,7 @@ translate_compat_table(struct net *net,
> duprintf("translate_compat_table: size %u\n", info->size);
> j = 0;
> xt_compat_lock(AF_INET6);
> + xt_compat_init_offsets(AF_INET6, number);
> /* Walk through entries, checking offsets. */
> xt_entry_foreach(iter0, entry0, total_size) {
> ret = check_compat_entry_size_and_hooks(iter0, info, &size,
> diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
> index 8046350..75182ed 100644
> --- a/net/netfilter/x_tables.c
> +++ b/net/netfilter/x_tables.c
> @@ -38,9 +38,8 @@ MODULE_DESCRIPTION("{ip,ip6,arp,eb}_tables backend module");
> #define SMP_ALIGN(x) (((x) + SMP_CACHE_BYTES-1) & ~(SMP_CACHE_BYTES-1))
>
> struct compat_delta {
> - struct compat_delta *next;
> - unsigned int offset;
> - int delta;
> + unsigned int offset; /* offset in kernel */
> + int delta; /* delta in 32bit user land */
> };
>
> struct xt_af {
> @@ -49,7 +48,9 @@ struct xt_af {
> struct list_head target;
> #ifdef CONFIG_COMPAT
> struct mutex compat_mutex;
> - struct compat_delta *compat_offsets;
> + struct compat_delta *compat_tab;
> + unsigned int number; /* number of slots in compat_tab[] */
> + unsigned int cur; /* number of used slots in compat_tab[] */
> #endif
> };
>
> @@ -414,54 +415,67 @@ int xt_check_match(struct xt_mtchk_param *par,
> EXPORT_SYMBOL_GPL(xt_check_match);
>
> #ifdef CONFIG_COMPAT
> -int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta)
> +int xt_compat_add_offset(u_int8_t af, unsigned int offset, int delta)
> {
> - struct compat_delta *tmp;
> + struct xt_af *xp = &xt[af];
>
> - tmp = kmalloc(sizeof(struct compat_delta), GFP_KERNEL);
> - if (!tmp)
> - return -ENOMEM;
> + if (!xp->compat_tab) {
> + if (!xp->number)
> + return -EINVAL;
> + xp->compat_tab = vmalloc(sizeof(struct compat_delta) * xp->number);
> + if (!xp->compat_tab)
> + return -ENOMEM;
> + xp->cur = 0;
> + }
>
> - tmp->offset = offset;
> - tmp->delta = delta;
> + if (xp->cur >= xp->number)
> + return -EINVAL;
minor glitch: We leak xp->compat_tab if this error condition above is true.
>
> - if (xt[af].compat_offsets) {
> - tmp->next = xt[af].compat_offsets->next;
> - xt[af].compat_offsets->next = tmp;
> - } else {
> - xt[af].compat_offsets = tmp;
> - tmp->next = NULL;
> - }
> + if (xp->cur)
> + delta += xp->compat_tab[xp->cur - 1].delta;
> + xp->compat_tab[xp->cur].offset = offset;
> + xp->compat_tab[xp->cur].delta = delta;
> + xp->cur++;
> return 0;
> }
> EXPORT_SYMBOL_GPL(xt_compat_add_offset);
>
> void xt_compat_flush_offsets(u_int8_t af)
> {
> - struct compat_delta *tmp, *next;
> -
> - if (xt[af].compat_offsets) {
> - for (tmp = xt[af].compat_offsets; tmp; tmp = next) {
> - next = tmp->next;
> - kfree(tmp);
> - }
> - xt[af].compat_offsets = NULL;
> + if (xt[af].compat_tab) {
> + vfree(xt[af].compat_tab);
> + xt[af].compat_tab = NULL;
> + xt[af].number = 0;
> }
> }
> EXPORT_SYMBOL_GPL(xt_compat_flush_offsets);
>
> int xt_compat_calc_jump(u_int8_t af, unsigned int offset)
> {
> - struct compat_delta *tmp;
> - int delta;
> -
> - for (tmp = xt[af].compat_offsets, delta = 0; tmp; tmp = tmp->next)
> - if (tmp->offset < offset)
> - delta += tmp->delta;
> - return delta;
> + struct compat_delta *tmp = xt[af].compat_tab;
> + int mid, left = 0, right = xt[af].cur - 1;
> +
> + while (left <= right) {
> + mid = (left + right) >> 1;
> + if (offset > tmp[mid].offset)
> + left = mid + 1;
> + else if (offset < tmp[mid].offset)
> + right = mid - 1;
> + else
> + return mid ? tmp[mid - 1].delta : 0;
> + }
> + WARN_ON_ONCE(1);
> + return 0;
> }
> EXPORT_SYMBOL_GPL(xt_compat_calc_jump);
>
> +void xt_compat_init_offsets(u_int8_t af, unsigned int number)
> +{
> + xt[af].number = number;
> + xt[af].cur = 0;
> +}
> +EXPORT_SYMBOL(xt_compat_init_offsets);
> +
> int xt_compat_match_offset(const struct xt_match *match)
> {
> u_int16_t csize = match->compatsize ? : match->matchsize;
> @@ -1337,7 +1351,7 @@ static int __init xt_init(void)
> mutex_init(&xt[i].mutex);
> #ifdef CONFIG_COMPAT
> mutex_init(&xt[i].compat_mutex);
> - xt[i].compat_offsets = NULL;
> + xt[i].compat_tab = NULL;
> #endif
> INIT_LIST_HEAD(&xt[i].target);
> INIT_LIST_HEAD(&xt[i].match);
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH V8 02/13] ntp: add ADJ_SETOFFSET mode bit
From: Kuwahara,T. @ 2011-01-12 20:39 UTC (permalink / raw)
To: john stultz
Cc: Richard Cochran, linux-kernel, linux-api, netdev, Alan Cox,
Arnd Bergmann, Christoph Lameter, David Miller, Krzysztof Halasa,
Peter Zijlstra, Rodolfo Giometti, Thomas Gleixner
In-Reply-To: <1294779309.3441.66.camel@work-vm>
On Wed, Jan 12, 2011 at 5:55 AM, john stultz <johnstul@us.ibm.com> wrote:
> So the kernel handles leap second insertion via a timer. Thus at the end
> of 23:59:59, it will inject a leapsecond by setting the time back by one
> second (back to 23:59:59) and setting the TIME_OOP flag.
>
> This timer is an absolute timer, so if someone moves the clock forward
> across the 23:59:59 boundary, the adjustment will still be made.
>
> The patch is not broken, nor useless.
It takes into account only one upcoming leap second, but ignores all
the others. That's not sufficient for arbitrary adjustments.
^ permalink raw reply
* Re: [GIT PULL nf-next-2.6] ipvs namespaces
From: Pablo Neira Ayuso @ 2011-01-12 20:29 UTC (permalink / raw)
To: Simon Horman
Cc: netfilter-devel, lvs-devel, netdev, Patrick McHardy,
Julian Anastasov, Hans Schillstrom
In-Reply-To: <1294294578-8601-1-git-send-email-horms@verge.net.au>
Hi Simon,
On 06/01/11 07:15, Simon Horman wrote:
> Hi Patrick,
>
> please consider pulling
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/lvs-test-2.6.git master
> in order to get the netns changes to IPVS from Hans Schillstrom.
I'm hitting some conflicts when pulling from your tree.
>From git://git.kernel.org/pub/scm/linux/kernel/git/horms/lvs-test-2.6
* branch master -> FETCH_HEAD
Auto-merging include/linux/netfilter.h
Auto-merging include/linux/skbuff.h
Auto-merging include/net/netfilter/nf_conntrack.h
Auto-merging net/core/skbuff.c
Auto-merging net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
Auto-merging net/ipv6/netfilter/nf_conntrack_reasm.c
Auto-merging net/netfilter/core.c
Auto-merging net/netfilter/ipvs/ip_vs_ctl.c
CONFLICT (content): Merge conflict in net/netfilter/ipvs/ip_vs_ctl.c
^ permalink raw reply
* Re: XT_MATCH_REALM Kconfig whinge...
From: Pablo Neira Ayuso @ 2011-01-12 19:48 UTC (permalink / raw)
To: Valdis.Kletnieks
Cc: Patrick McHardy, David S. Miller, linux-kernel, netfilter-devel,
netdev
In-Reply-To: <20519.1294859715@localhost>
[-- Attachment #1: Type: text/plain, Size: 358 bytes --]
On 12/01/11 20:15, Valdis.Kletnieks@vt.edu wrote:
> scripts/kconfig/conf --silentoldconfig Kconfig
> warning: (NETFILTER_XT_MATCH_REALM) selects NET_CLS_ROUTE which has unmet direct dependencies (NET && NET_SCHED)
> warning: (NETFILTER_XT_MATCH_REALM) selects NET_CLS_ROUTE which has unmet direct dependencies (NET && NET_SCHED)
Does this fix your problem?
[-- Attachment #2: realm.patch --]
[-- Type: text/x-patch, Size: 942 bytes --]
netfilter: xt_realm: fix unmet direct dependencies
scripts/kconfig/conf --silentoldconfig Kconfig
warning: (NETFILTER_XT_MATCH_REALM) selects NET_CLS_ROUTE which has unmet direct dependencies (NET && NET_SCHED)
warning: (NETFILTER_XT_MATCH_REALM) selects NET_CLS_ROUTE which has unmet direct dependencies (NET && NET_SCHED)
Reported by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index 1534f2b..ae56764 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -886,7 +886,8 @@ config NETFILTER_XT_MATCH_RATEEST
config NETFILTER_XT_MATCH_REALM
tristate '"realm" match support'
depends on NETFILTER_ADVANCED
- select NET_CLS_ROUTE
+ depends on NET_SCHED
+ depends on NET_CLS_ROUTE
help
This option adds a `realm' match, which allows you to use the realm
key from the routing subsystem inside iptables.
^ permalink raw reply related
* Re: [PATCH v2] net: Allow ethtool to set interface in loopback mode.
From: Mahesh Bandewar @ 2011-01-12 19:24 UTC (permalink / raw)
To: Ben Hutchings
Cc: Jeff Garzik, Stephen Hemminger, David Miller, Laurent Chavey,
Tom Herbert, netdev
In-Reply-To: <1294352011.11825.50.camel@bwh-desktop>
On Thu, Jan 6, 2011 at 2:13 PM, Ben Hutchings <bhutchings@solarflare.com> wrote:
> On Wed, 2011-01-05 at 11:22 -0500, Jeff Garzik wrote:
>> On 01/04/2011 08:21 PM, Ben Hutchings wrote:
>> > On Tue, 2011-01-04 at 16:36 -0800, Stephen Hemminger wrote:
>> >> On Tue, 4 Jan 2011 16:30:01 -0800
>> >> Mahesh Bandewar<maheshb@google.com> wrote:
>> >>
>> >>> This patch enables ethtool to set the loopback mode on a given interface.
>> >>> By configuring the interface in loopback mode in conjunction with a policy
>> >>> route / rule, a userland application can stress the egress / ingress path
>> >>> exposing the flows of the change in progress and potentially help developer(s)
>> >>> understand the impact of those changes without even sending a packet out
>> >>> on the network.
>> >>>
>> >>> Following set of commands illustrates one such example -
>> >>> a) ip -4 addr add 192.168.1.1/24 dev eth1
>> >>> b) ip -4 rule add from all iif eth1 lookup 250
>> >>> c) ip -4 route add local 0/0 dev lo proto kernel scope host table 250
>> >>> d) arp -Ds 192.168.1.100 eth1
>> >>> e) arp -Ds 192.168.1.200 eth1
>> >>> f) sysctl -w net.ipv4.ip_nonlocal_bind=1
>> >>> g) sysctl -w net.ipv4.conf.all.accept_local=1
>> >>> # Assuming that the machine has 8 cores
>> >>> h) taskset 000f netserver -L 192.168.1.200
>> >>> i) taskset 00f0 netperf -t TCP_CRR -L 192.168.1.100 -H 192.168.1.200 -l 30
>> >>>
>> >>> Signed-off-by: Mahesh Bandewar<maheshb@google.com>
>> >>> Reviewed-by: Ben Hutchings<bhutchings@solarflare.com>
>> >>
>> >> Since this is a boolean it SHOULD go into ethtool_flags rather than
>> >> being a high level operation.
>> >
>> > It could do, but I though ETHTOOL_{G,S}FLAGS were intended for
>> > controlling offload features.
>>
>> It doesn't have to be. As Stephen guessed, [GS]FLAGS are basically
>> common flags -- as differentiated from private,
>> driver-specific/hardware-specific flags.
>
> Well, that would allow the patch to be simplified quite a bit. :-)
>
> Ben.
>
> From: Ben Hutchings <bhutchings@solarflare.com>
> Subject: [PATCH net-2.6] ethtool: Define ETH_FLAG_LOOPBACK
> Date: Thu, 6 Jan 2011 22:10:55 +0000
>
> Mahesh Bandewar <maheshb@google.com> requested this, writing:
>
> By configuring the interface in loopback mode in conjunction with a policy
> route / rule, a userland application can stress the egress / ingress path
> exposing the flows of the change in progress and potentially help developer(s)
> understand the impact of those changes without even sending a packet out
> on the network.
>
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Mahesh Bandewar <maheshb@google.com>
>
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -309,6 +309,7 @@ struct ethtool_perm_addr {
> * flag differs from the read-only value.
> */
> enum ethtool_flags {
> + ETH_FLAG_LOOPBACK = (1 << 2), /* Host-side loopback enabled */
> ETH_FLAG_TXVLAN = (1 << 7), /* TX VLAN offload enabled */
> ETH_FLAG_RXVLAN = (1 << 8), /* RX VLAN offload enabled */
> ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
> ---
I tried this one with e1000e driver changes. It works but the ethtool
changes are not very clean and I would still prefer the earlier patch
since changes are clean across the board. I'll post ethtool changes
soon.
>
> --
> Ben Hutchings, Senior Software Engineer, Solarflare Communications
> Not speaking for my employer; that's the marketing department's job.
> They asked us to note that Solarflare product names are trademarked.
>
>
^ permalink raw reply
* XT_MATCH_REALM Kconfig whinge...
From: Valdis.Kletnieks @ 2011-01-12 19:15 UTC (permalink / raw)
To: Patrick McHardy, David S. Miller; +Cc: linux-kernel, netfilter-devel, netdev
[-- Attachment #1: Type: text/plain, Size: 405 bytes --]
I think I posted about this a long ways back, still seeing it in yesterday's linux-next:
scripts/kconfig/conf --silentoldconfig Kconfig
warning: (NETFILTER_XT_MATCH_REALM) selects NET_CLS_ROUTE which has unmet direct dependencies (NET && NET_SCHED)
warning: (NETFILTER_XT_MATCH_REALM) selects NET_CLS_ROUTE which has unmet direct dependencies (NET && NET_SCHED)
(NET is of course set, NET_SCHED isn't).
[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply
* [PATCH] inet6: prevent network storms caused by linux IPv6 routers
From: Alexey Kuznetsov @ 2011-01-12 18:34 UTC (permalink / raw)
To: netdev, davem
Linux IPv6 forwards unicast packets, which are link layer multicasts...
The hole was present since day one. I was 100% this check is there, but it is not.
The problem shows itself, f.e. when Microsoft Network Load Balancer runs on a network.
This software resolves IPv6 unicast addresses to multicast MAC addresses.
Signed-off-by: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
---
net/ipv6/ip6_output.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 94b5bf1..5f8d242 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -401,6 +401,9 @@ int ip6_forward(struct sk_buff *skb)
goto drop;
}
+ if (skb->pkt_type != PACKET_HOST)
+ goto drop;
+
skb_forward_csum(skb);
/*
--
1.7.2.3
^ permalink raw reply related
* Re: [PATCH v1 2/2] TCPCT API sockopt update to draft -03
From: Stephen Hemminger @ 2011-01-12 18:56 UTC (permalink / raw)
To: William Allen Simpson
Cc: Linux Kernel Developers, Linux Kernel Network Developers,
David Miller, Andrew Morton
In-Reply-To: <4D2DEC0A.70608@gmail.com>
On Wed, 12 Jan 2011 12:59:38 -0500
William Allen Simpson <william.allen.simpson@gmail.com> wrote:
> diff --git a/include/linux/tcp.h b/include/linux/tcp.h
> index e64f4c6..c8f4017 100644
> --- a/include/linux/tcp.h
> +++ b/include/linux/tcp.h
> @@ -185,22 +185,37 @@ struct tcp_md5sig {
> #define TCP_COOKIE_PAIR_SIZE (2*TCP_COOKIE_MAX)
>
> /* Flags for both getsockopt and setsockopt */
> -#define TCP_COOKIE_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */
> -#define TCP_COOKIE_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies,
> +#define TCPCT_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */
> +#define TCPCT_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies,
You end up changing values in kernel userspace API in a way
that is incompatible with older applications. This is not acceptable.
^ permalink raw reply
* pull request: wireless-2.6 2011-01-12
From: John W. Linville @ 2011-01-12 18:37 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Dave,
This is an initial batch of wireless fixes intended for 2.6.38-rc1.
Highlights include a number of small ath9k fixes, some documentation
fixes from Johannes, and an ssb fix that stops loading b44 inadvertently
when certain b43 devices are present.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit 5b919f833d9d60588d026ad82d17f17e8872c7a9:
net: ax25: fix information leak to userland harder (2011-01-12 00:34:49 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git master
Christian Lamparter (1):
p54: fix sequence no. accounting off-by-one error
Indan Zupancic (1):
ipw2200: Check for -1 INTA in tasklet too.
Johannes Berg (5):
mac80211: add remain-on-channel docs
mac80211: add missing docs for off-chan TX flag
cfg80211: add mesh join/leave callback docs
nl80211: add/fix mesh docs
mac80211: add doc short section on LED triggers
Michael Buesch (1):
ssb: Ignore dangling ethernet cores on wireless devices
Stanislaw Gruszka (1):
hostap_cs: fix sleeping function called from invalid context
Sujith Manoharan (5):
ath9k_hw: Fix chip test
ath9k_hw: Fix calibration for AR9287 devices
ath9k_hw: Fix thermal issue with UB94
ath9k_hw: Fix RX handling for USB devices
ath9k_htc: Really fix packet injection
Documentation/DocBook/80211.tmpl | 21 +++++++++++---
drivers/net/wireless/ath/ath9k/ar9002_calib.c | 3 ++
drivers/net/wireless/ath/ath9k/eeprom_def.c | 4 +++
drivers/net/wireless/ath/ath9k/htc.h | 1 +
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 37 +++++++++++++++++-------
drivers/net/wireless/ath/ath9k/hw.c | 5 ++-
drivers/net/wireless/hostap/hostap_cs.c | 15 ++++------
drivers/net/wireless/ipw2x00/ipw2200.c | 7 +++++
drivers/net/wireless/p54/txrx.c | 2 +-
drivers/ssb/scan.c | 10 +++++++
include/linux/nl80211.h | 20 ++++++++++---
include/net/cfg80211.h | 2 +
include/net/mac80211.h | 14 +++++++++
13 files changed, 109 insertions(+), 32 deletions(-)
diff --git a/Documentation/DocBook/80211.tmpl b/Documentation/DocBook/80211.tmpl
index 03641a0..8906648 100644
--- a/Documentation/DocBook/80211.tmpl
+++ b/Documentation/DocBook/80211.tmpl
@@ -268,10 +268,6 @@
!Finclude/net/mac80211.h ieee80211_ops
!Finclude/net/mac80211.h ieee80211_alloc_hw
!Finclude/net/mac80211.h ieee80211_register_hw
-!Finclude/net/mac80211.h ieee80211_get_tx_led_name
-!Finclude/net/mac80211.h ieee80211_get_rx_led_name
-!Finclude/net/mac80211.h ieee80211_get_assoc_led_name
-!Finclude/net/mac80211.h ieee80211_get_radio_led_name
!Finclude/net/mac80211.h ieee80211_unregister_hw
!Finclude/net/mac80211.h ieee80211_free_hw
</chapter>
@@ -382,6 +378,23 @@
</para>
</partintro>
+ <chapter id="led-support">
+ <title>LED support</title>
+ <para>
+ Mac80211 supports various ways of blinking LEDs. Wherever possible,
+ device LEDs should be exposed as LED class devices and hooked up to
+ the appropriate trigger, which will then be triggered appropriately
+ by mac80211.
+ </para>
+!Finclude/net/mac80211.h ieee80211_get_tx_led_name
+!Finclude/net/mac80211.h ieee80211_get_rx_led_name
+!Finclude/net/mac80211.h ieee80211_get_assoc_led_name
+!Finclude/net/mac80211.h ieee80211_get_radio_led_name
+!Finclude/net/mac80211.h ieee80211_tpt_blink
+!Finclude/net/mac80211.h ieee80211_tpt_led_trigger_flags
+!Finclude/net/mac80211.h ieee80211_create_tpt_led_trigger
+ </chapter>
+
<chapter id="hardware-crypto-offload">
<title>Hardware crypto acceleration</title>
!Pinclude/net/mac80211.h Hardware crypto acceleration
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
index 01880aa..ea2e7d7 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
@@ -954,6 +954,9 @@ static void ar9002_hw_init_cal_settings(struct ath_hw *ah)
&adc_dc_cal_multi_sample;
}
ah->supp_cals = ADC_GAIN_CAL | ADC_DC_CAL | IQ_MISMATCH_CAL;
+
+ if (AR_SREV_9287(ah))
+ ah->supp_cals &= ~ADC_GAIN_CAL;
}
}
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index 088f141..749a936 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -226,6 +226,10 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
eep->baseEepHeader.pwdclkind == 0)
ah->need_an_top2_fixup = 1;
+ if ((common->bus_ops->ath_bus_type == ATH_USB) &&
+ (AR_SREV_9280(ah)))
+ eep->modalHeader[0].xpaBiasLvl = 0;
+
return 0;
}
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index a099b3e..1ce506f 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -433,6 +433,7 @@ void ath9k_htc_txep(void *priv, struct sk_buff *skb, enum htc_endpoint_id ep_id,
void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,
enum htc_endpoint_id ep_id, bool txok);
+int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv);
void ath9k_htc_station_work(struct work_struct *work);
void ath9k_htc_aggr_work(struct work_struct *work);
void ath9k_ani_work(struct work_struct *work);;
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 845b4c9..f4d576b 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -301,6 +301,16 @@ static int ath9k_htc_add_monitor_interface(struct ath9k_htc_priv *priv)
priv->nstations++;
+ /*
+ * Set chainmask etc. on the target.
+ */
+ ret = ath9k_htc_update_cap_target(priv);
+ if (ret)
+ ath_dbg(common, ATH_DBG_CONFIG,
+ "Failed to update capability in target\n");
+
+ priv->ah->is_monitoring = true;
+
return 0;
err_vif:
@@ -328,6 +338,7 @@ static int ath9k_htc_remove_monitor_interface(struct ath9k_htc_priv *priv)
}
priv->nstations--;
+ priv->ah->is_monitoring = false;
return 0;
}
@@ -419,7 +430,7 @@ static int ath9k_htc_remove_station(struct ath9k_htc_priv *priv,
return 0;
}
-static int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv)
+int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv)
{
struct ath9k_htc_cap_target tcap;
int ret;
@@ -1186,6 +1197,20 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
}
}
+ /*
+ * Monitor interface should be added before
+ * IEEE80211_CONF_CHANGE_CHANNEL is handled.
+ */
+ if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
+ if (conf->flags & IEEE80211_CONF_MONITOR) {
+ if (ath9k_htc_add_monitor_interface(priv))
+ ath_err(common, "Failed to set monitor mode\n");
+ else
+ ath_dbg(common, ATH_DBG_CONFIG,
+ "HW opmode set to Monitor mode\n");
+ }
+ }
+
if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
struct ieee80211_channel *curchan = hw->conf.channel;
int pos = curchan->hw_value;
@@ -1221,16 +1246,6 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
ath_update_txpow(priv);
}
- if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
- if (conf->flags & IEEE80211_CONF_MONITOR) {
- if (ath9k_htc_add_monitor_interface(priv))
- ath_err(common, "Failed to set monitor mode\n");
- else
- ath_dbg(common, ATH_DBG_CONFIG,
- "HW opmode set to Monitor mode\n");
- }
- }
-
if (changed & IEEE80211_CONF_CHANGE_IDLE) {
mutex_lock(&priv->htc_pm_lock);
if (!priv->ps_idle) {
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index fde9786..1afb8bb 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -436,9 +436,10 @@ static int ath9k_hw_init_macaddr(struct ath_hw *ah)
static int ath9k_hw_post_init(struct ath_hw *ah)
{
+ struct ath_common *common = ath9k_hw_common(ah);
int ecode;
- if (!AR_SREV_9271(ah)) {
+ if (common->bus_ops->ath_bus_type != ATH_USB) {
if (!ath9k_hw_chip_test(ah))
return -ENODEV;
}
@@ -1213,7 +1214,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
ah->txchainmask = common->tx_chainmask;
ah->rxchainmask = common->rx_chainmask;
- if (!ah->chip_fullsleep) {
+ if ((common->bus_ops->ath_bus_type != ATH_USB) && !ah->chip_fullsleep) {
ath9k_hw_abortpcurecv(ah);
if (!ath9k_hw_stopdmarecv(ah)) {
ath_dbg(common, ATH_DBG_XMIT,
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index bd8a413..2176ede 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -518,22 +518,21 @@ static int prism2_config(struct pcmcia_device *link)
hw_priv->link = link;
/*
- * Make sure the IRQ handler cannot proceed until at least
- * dev->base_addr is initialized.
+ * We enable IRQ here, but IRQ handler will not proceed
+ * until dev->base_addr is set below. This protect us from
+ * receive interrupts when driver is not initialized.
*/
- spin_lock_irqsave(&local->irq_init_lock, flags);
-
ret = pcmcia_request_irq(link, prism2_interrupt);
if (ret)
- goto failed_unlock;
+ goto failed;
ret = pcmcia_enable_device(link);
if (ret)
- goto failed_unlock;
+ goto failed;
+ spin_lock_irqsave(&local->irq_init_lock, flags);
dev->irq = link->irq;
dev->base_addr = link->resource[0]->start;
-
spin_unlock_irqrestore(&local->irq_init_lock, flags);
local->shutdown = 0;
@@ -546,8 +545,6 @@ static int prism2_config(struct pcmcia_device *link)
return ret;
- failed_unlock:
- spin_unlock_irqrestore(&local->irq_init_lock, flags);
failed:
kfree(hw_priv);
prism2_release((u_long)link);
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 8d6ed5f..ae438ed 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -1973,6 +1973,13 @@ static void ipw_irq_tasklet(struct ipw_priv *priv)
inta = ipw_read32(priv, IPW_INTA_RW);
inta_mask = ipw_read32(priv, IPW_INTA_MASK_R);
+
+ if (inta == 0xFFFFFFFF) {
+ /* Hardware disappeared */
+ IPW_WARNING("TASKLET INTA == 0xFFFFFFFF\n");
+ /* Only handle the cached INTA values */
+ inta = 0;
+ }
inta &= (IPW_INTA_MASK_ALL & inta_mask);
/* Add any cached INTA values that need to be handled */
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 76b2318..f618b96 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -618,7 +618,7 @@ static void p54_tx_80211_header(struct p54_common *priv, struct sk_buff *skb,
else
*burst_possible = false;
- if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)
+ if (!(info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ))
*flags |= P54_HDR_FLAG_DATA_OUT_SEQNR;
if (info->flags & IEEE80211_TX_CTL_PSPOLL_RESPONSE)
diff --git a/drivers/ssb/scan.c b/drivers/ssb/scan.c
index 5a0985d..29884c0 100644
--- a/drivers/ssb/scan.c
+++ b/drivers/ssb/scan.c
@@ -420,6 +420,16 @@ int ssb_bus_scan(struct ssb_bus *bus,
bus->pcicore.dev = dev;
#endif /* CONFIG_SSB_DRIVER_PCICORE */
break;
+ case SSB_DEV_ETHERNET:
+ if (bus->bustype == SSB_BUSTYPE_PCI) {
+ if (bus->host_pci->vendor == PCI_VENDOR_ID_BROADCOM &&
+ (bus->host_pci->device & 0xFF00) == 0x4300) {
+ /* This is a dangling ethernet core on a
+ * wireless device. Ignore it. */
+ continue;
+ }
+ }
+ break;
default:
break;
}
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 2b89b71..821ffb9 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -148,6 +148,10 @@
* @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to
* destination %NL80211_ATTR_MAC on the interface identified by
* %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by
+ * %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP.
+ * @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by
+ * %NL80211_ATTR_MAC.
* @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the
* the interface identified by %NL80211_ATTR_IFINDEX.
* @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC
@@ -612,7 +616,7 @@ enum nl80211_commands {
* consisting of a nested array.
*
* @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes).
- * @NL80211_ATTR_PLINK_ACTION: action to perform on the mesh peer link.
+ * @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link.
* @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
* @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
* info given for %NL80211_CMD_GET_MPATH, nested attribute described at
@@ -879,7 +883,9 @@ enum nl80211_commands {
* See &enum nl80211_key_default_types.
*
* @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters. These cannot be
- * changed once the mesh is active.
+ * changed once the mesh is active.
+ * @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute
+ * containing attributes from &enum nl80211_meshconf_params.
*
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -1225,8 +1231,6 @@ enum nl80211_rate_info {
* @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs)
* @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station)
* @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station)
- * @__NL80211_STA_INFO_AFTER_LAST: internal
- * @NL80211_STA_INFO_MAX: highest possible station info attribute
* @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm)
* @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute
* containing info as possible, see &enum nl80211_sta_info_txrate.
@@ -1236,6 +1240,11 @@ enum nl80211_rate_info {
* @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station)
* @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station)
* @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm)
+ * @NL80211_STA_INFO_LLID: the station's mesh LLID
+ * @NL80211_STA_INFO_PLID: the station's mesh PLID
+ * @NL80211_STA_INFO_PLINK_STATE: peer link state for the station
+ * @__NL80211_STA_INFO_AFTER_LAST: internal
+ * @NL80211_STA_INFO_MAX: highest possible station info attribute
*/
enum nl80211_sta_info {
__NL80211_STA_INFO_INVALID,
@@ -1626,7 +1635,7 @@ enum nl80211_mntr_flags {
* @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs)
* that it takes for an HWMP information element to propagate across the mesh
*
- * @NL80211_MESHCONF_ROOTMODE: whether root mode is enabled or not
+ * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not
*
* @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a
* source mesh point for path selection elements.
@@ -1678,6 +1687,7 @@ enum nl80211_meshconf_params {
* element that vendors will use to identify the path selection methods and
* metrics in use.
*
+ * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
* @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
*/
enum nl80211_mesh_setup_params {
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index bcc9f44..1322695 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1103,6 +1103,8 @@ struct cfg80211_pmksa {
* @change_mpath: change a given mesh path
* @get_mpath: get a mesh path for the given parameters
* @dump_mpath: dump mesh path callback -- resume dump at index @idx
+ * @join_mesh: join the mesh network with the specified parameters
+ * @leave_mesh: leave the current mesh network
*
* @get_mesh_config: Get the current mesh configuration
*
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 5b3fd5a..62c0ce2 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -337,6 +337,10 @@ struct ieee80211_bss_conf {
* @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame
* @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this
* frame and selects the maximum number of streams that it can use.
+ * @IEEE80211_TX_CTL_TX_OFFCHAN: Marks this packet to be transmitted on
+ * the off-channel channel when a remain-on-channel offload is done
+ * in hardware -- normal packets still flow and are expected to be
+ * handled properly by the device.
*
* Note: If you have to add new flags to the enumeration, then don't
* forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
@@ -1753,6 +1757,16 @@ enum ieee80211_ampdu_mlme_action {
* (also see nl80211.h @NL80211_ATTR_WIPHY_ANTENNA_TX).
*
* @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant).
+ *
+ * @remain_on_channel: Starts an off-channel period on the given channel, must
+ * call back to ieee80211_ready_on_channel() when on that channel. Note
+ * that normal channel traffic is not stopped as this is intended for hw
+ * offload. Frames to transmit on the off-channel channel are transmitted
+ * normally except for the %IEEE80211_TX_CTL_TX_OFFCHAN flag. When the
+ * duration (which will always be non-zero) expires, the driver must call
+ * ieee80211_remain_on_channel_expired(). This callback may sleep.
+ * @cancel_remain_on_channel: Requests that an ongoing off-channel period is
+ * aborted before it expires. This callback may sleep.
*/
struct ieee80211_ops {
int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
--
John W. Linville Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org might be all we have. Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* RE: [E1000-devel] [e100] Page allocation failure warning(?) in 2.6.36.3
From: Eric Dumazet @ 2011-01-12 18:14 UTC (permalink / raw)
To: Brandeburg, Jesse
Cc: David Miller, Chris Rankin, e1000-devel@lists.sourceforge.net,
Dave, Tushar N, netdev@vger.kernel.org, Kirsher, Jeffrey T
In-Reply-To: <alpine.WNT.2.00.1101120958080.5816@JBRANDEB-DESK2.amr.corp.intel.com>
Le mercredi 12 janvier 2011 à 10:05 -0800, Brandeburg, Jesse a écrit :
> First, I don't think the following comment should hold up this patch.
>
> As a policy question when I asked about using __GFP_NOWARN before in other
> Intel ethernet drivers the consensus seemed to be that the warning
> messages were useful. All our drivers correctly handle runtime memory
> failures, but none of them are currently using __GFP_NOWARN.
>
> Can I submit patches to change our other drivers to __GFP_NOWARN? I think
> it will make for quite a few less reports of non-issues to the list. All
> our drivers that I would be patching already have ethtool counters that
> count failed allocations.
>
If an allocation failure is really handled, in the sense NIC doesnt
freeze but only lose one incoming frame, then probably yes.
I think the warning message can be useful when driver is known to let
things in a non working state ;)
As you said, this can be done later, here is a respin without this bit.
Thanks !
[PATCH v2] e100: use GFP_KERNEL allocations at device init stage
In lowmem conditions, e100 driver can fail its initialization, because
of GFP_ATOMIC abuse.
Switch to GFP_KERNEL were applicable.
Reported-by: Chris Rankin <rankincj@yahoo.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/e100.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index b0aa9e6..c9a2126 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1880,9 +1880,21 @@ static inline void e100_start_receiver(struct nic *nic, struct rx *rx)
}
#define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN)
-static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
+
+static struct sk_buff *e100_alloc_skb(struct net_device *dev, gfp_t flags)
+{
+ struct sk_buff *skb;
+
+ skb = __netdev_alloc_skb(dev, RFD_BUF_LEN + NET_IP_ALIGN, flags);
+ if (NET_IP_ALIGN && skb)
+ skb_reserve(skb, NET_IP_ALIGN);
+ return skb;
+}
+
+static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx, gfp_t flags)
{
- if (!(rx->skb = netdev_alloc_skb_ip_align(nic->netdev, RFD_BUF_LEN)))
+ rx->skb = e100_alloc_skb(nic->netdev, flags);
+ if (!rx->skb)
return -ENOMEM;
/* Init, and map the RFD. */
@@ -2026,7 +2038,7 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done,
/* Alloc new skbs to refill list */
for (rx = nic->rx_to_use; !rx->skb; rx = nic->rx_to_use = rx->next) {
- if (unlikely(e100_rx_alloc_skb(nic, rx)))
+ if (unlikely(e100_rx_alloc_skb(nic, rx, GFP_ATOMIC)))
break; /* Better luck next time (see watchdog) */
}
@@ -2102,13 +2114,13 @@ static int e100_rx_alloc_list(struct nic *nic)
nic->rx_to_use = nic->rx_to_clean = NULL;
nic->ru_running = RU_UNINITIALIZED;
- if (!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_ATOMIC)))
+ if (!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_KERNEL)))
return -ENOMEM;
for (rx = nic->rxs, i = 0; i < count; rx++, i++) {
rx->next = (i + 1 < count) ? rx + 1 : nic->rxs;
rx->prev = (i == 0) ? nic->rxs + count - 1 : rx - 1;
- if (e100_rx_alloc_skb(nic, rx)) {
+ if (e100_rx_alloc_skb(nic, rx, GFP_KERNEL)) {
e100_rx_clean_list(nic);
return -ENOMEM;
}
^ permalink raw reply related
* Re: [PATCH v1 1/2] TCPCT API sysctl update to draft -03
From: Eric Dumazet @ 2011-01-12 18:05 UTC (permalink / raw)
To: William Allen Simpson
Cc: Linux Kernel Developers, Linux Kernel Network Developers,
David Miller, Andrew Morton
In-Reply-To: <4D2DEA73.4000708@gmail.com>
Le mercredi 12 janvier 2011 à 12:52 -0500, William Allen Simpson a
écrit :
> Use most recently specified symbols of RFC-to-be-6013.
>
> Allows different global s_data limits for SYN and SYN_ACK.
>
> CC: "Eric W. Biederman" <ebiederm@xmission.com>
> CC: Stephen Hemminger <shemminger@vyatta.com>
> CC: Andi Kleen <andi@firstfloor.org>
> Signed-off-by: William.Allen.Simpson@gmail.com
Should be :
Signed-off-by: William Allen Simpson <William.Allen.Simpson@gmail.com>
> ---
> Documentation/networking/ip-sysctl.txt | 10 ++++++++++
> include/net/tcp.h | 2 ++
> net/ipv4/sysctl_net_ipv4.c | 25 ++++++++++++++++++++++++-
> net/ipv4/tcp_output.c | 19 +++++++++++++++++--
> 4 files changed, 53 insertions(+), 3 deletions(-)
Hmm, patch is not inlined, so I have to copy/paste
+static int tcp_cookie_max = TCP_COOKIE_MAX;
...
/* Update system visible IP port range */
static void set_local_port_range(int range[2])
@@ -588,7 +591,27 @@ static struct ctl_table ipv4_table[] = {
.data = &sysctl_tcp_cookie_size,
.maxlen = sizeof(int),
.mode = 0644,
- .proc_handler = proc_dointvec
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = &zero,
+ .extra2 = &tcp_cookie_max,
+ },
Now sysctl_tcp_cookie_size has a max limit of TCP_COOKIE_MAX, you can
remove the now uneeded check in :
static u8 tcp_cookie_size_check(u8 desired)
...
if (cookie_size >= TCP_COOKIE_MAX)
/* value too large, specify maximum */
return TCP_COOKIE_MAX;
^ permalink raw reply
* RE: [E1000-devel] [e100] Page allocation failure warning(?) in 2.6.36.3
From: Brandeburg, Jesse @ 2011-01-12 18:05 UTC (permalink / raw)
To: David Miller, Eric Dumazet
Cc: Chris Rankin, e1000-devel@lists.sourceforge.net, Dave, Tushar N,
netdev@vger.kernel.org, Kirsher, Jeffrey T
In-Reply-To: <1294853710.3981.108.camel@edumazet-laptop>
Hi Eric, thanks for doing this work!
On Wed, 12 Jan 2011, Eric Dumazet wrote:
> Apparently e100 driver uses GFP_ATOMIC allocations in setup phase, and
> your machine doesnt have enough memory.
This part looks great.
> I would try following patch, allowing the use of GFP_KERNEL at init
> time, to let vm games play.
>
> Thanks
>
> [PATCH] e100: use GFP_KERNEL allocations at device init stage
>
> In lowmem conditions, e100 driver can fail its initialization, because
> of GFP_ATOMIC abuse.
>
> Switch to GFP_KERNEL were applicable.
>
> Add __GFP_NOWARN flag to GFP_ATOMIC allocations, since driver can cope
> with failed allocations (if setup succeeded)
>
> Reported-by: Chris Rankin <rankincj@yahoo.com>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> - if (unlikely(e100_rx_alloc_skb(nic, rx)))
> + if (unlikely(e100_rx_alloc_skb(nic, rx,
> + GFP_ATOMIC | __GFP_NOWARN)))
First, I don't think the following comment should hold up this patch.
As a policy question when I asked about using __GFP_NOWARN before in other
Intel ethernet drivers the consensus seemed to be that the warning
messages were useful. All our drivers correctly handle runtime memory
failures, but none of them are currently using __GFP_NOWARN.
Can I submit patches to change our other drivers to __GFP_NOWARN? I think
it will make for quite a few less reports of non-issues to the list. All
our drivers that I would be patching already have ethtool counters that
count failed allocations.
^ permalink raw reply
* [PATCH v1 2/2] TCPCT API sockopt update to draft -03
From: William Allen Simpson @ 2011-01-12 17:59 UTC (permalink / raw)
To: Linux Kernel Developers
Cc: Linux Kernel Network Developers, David Miller, Andrew Morton
In-Reply-To: <4D2DE824.10205@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 517 bytes --]
Use most recently specified symbols of RFC-to-be-6013.
Permit setting either cookie or s_data (alternatively).
Split the data value from socket option header, saving more than
1K of stack space in the handler by copying long data values
directly from user space into the kref block.
Signed-off-by: William.Allen.Simpson@gmail.com
---
include/linux/tcp.h | 35 ++++++++++++-----
net/ipv4/tcp.c | 102 +++++++++++++++++++++++++++++++++++---------------
2 files changed, 96 insertions(+), 41 deletions(-)
[-- Attachment #2: TCPCT+API-03v1+2.6.37.patch --]
[-- Type: text/plain, Size: 7252 bytes --]
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index e64f4c6..c8f4017 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -185,22 +185,37 @@ struct tcp_md5sig {
#define TCP_COOKIE_PAIR_SIZE (2*TCP_COOKIE_MAX)
/* Flags for both getsockopt and setsockopt */
-#define TCP_COOKIE_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */
-#define TCP_COOKIE_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies,
+#define TCPCT_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */
+#define TCPCT_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies,
* supercedes everything. */
-
-/* Flags for getsockopt */
-#define TCP_S_DATA_IN (1 << 2) /* Was data received? */
-#define TCP_S_DATA_OUT (1 << 3) /* Was data sent? */
-
-/* TCP_COOKIE_TRANSACTIONS data */
+#define TCPCT_IN_DATA (1 << 2) /* Was data received? */
+#define TCPCT_OUT_DATA (1 << 3) /* Was data sent? */
+/* reserved for future use: bits 4 .. 6 */
+#define TCPCT_EXTEND (1 << 7)
+
+/* Extended Option flags for both getsockopt and setsockopt */
+#define TCPCT_EXTEND_SIZE (0x7) /* mask */
+#define TCPCT_EXTEND_TS32 (0x1) /* default */
+#define TCPCT_EXTEND_TS64 (0x2)
+#define TCPCT_EXTEND_TS128 (0x4)
+
+/* TCP_COOKIE_TRANSACTIONS socket option header */
struct tcp_cookie_transactions {
__u16 tcpct_flags; /* see above */
- __u8 __tcpct_pad1; /* zero */
+ __u8 tcpct_extended;
__u8 tcpct_cookie_desired; /* bytes */
__u16 tcpct_s_data_desired; /* bytes of variable data */
__u16 tcpct_used; /* bytes in value */
- __u8 tcpct_value[TCP_MSS_DEFAULT];
+};
+
+struct tcpct_full {
+ struct tcp_cookie_transactions soh;
+ __u8 tcpct_value[TCP_COOKIE_PAIR_SIZE];
+};
+
+struct tcpct_half {
+ struct tcp_cookie_transactions soh;
+ __u8 tcpct_value[TCP_COOKIE_MAX];
};
#ifdef __KERNEL__
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 6c11eec..a5c7933 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2143,25 +2143,14 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
case TCP_COOKIE_TRANSACTIONS: {
struct tcp_cookie_transactions ctd;
struct tcp_cookie_values *cvp = NULL;
+ int s_data_used = 0;
if (sizeof(ctd) > optlen)
return -EINVAL;
if (copy_from_user(&ctd, optval, sizeof(ctd)))
return -EFAULT;
- if (ctd.tcpct_used > sizeof(ctd.tcpct_value) ||
- ctd.tcpct_s_data_desired > TCP_MSS_DESIRED)
- return -EINVAL;
-
- if (ctd.tcpct_cookie_desired == 0) {
- /* default to global value */
- } else if ((0x1 & ctd.tcpct_cookie_desired) ||
- ctd.tcpct_cookie_desired > TCP_COOKIE_MAX ||
- ctd.tcpct_cookie_desired < TCP_COOKIE_MIN) {
- return -EINVAL;
- }
-
- if (TCP_COOKIE_OUT_NEVER & ctd.tcpct_flags) {
+ if (TCPCT_OUT_NEVER & ctd.tcpct_flags) {
/* Supercedes all other values */
lock_sock(sk);
if (tp->cookie_values != NULL) {
@@ -2175,6 +2164,41 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
return err;
}
+ if (ctd.tcpct_cookie_desired == 0) {
+ /* default to global value */
+ } else if ((0x1 & ctd.tcpct_cookie_desired) ||
+ ctd.tcpct_cookie_desired > TCP_COOKIE_MAX ||
+ ctd.tcpct_cookie_desired < TCP_COOKIE_MIN) {
+ return -EINVAL;
+ }
+
+ if (ctd.tcpct_used > 0) {
+ if (ctd.tcpct_used + sizeof(ctd) > optlen)
+ return -EINVAL;
+ if (TCPCT_OUT_DATA & ctd.tcpct_flags) {
+ if (ctd.tcpct_used >
+ sysctl_tcp_syn_ack_data_limit)
+ return -EINVAL;
+ if (ctd.tcpct_s_data_desired > 0)
+ return -EINVAL;
+ s_data_used = ctd.tcpct_used;
+ } else {
+ if (ctd.tcpct_used > TCP_COOKIE_PAIR_SIZE)
+ return -EINVAL;
+ if (ctd.tcpct_used !=
+ ctd.tcpct_cookie_desired &&
+ ctd.tcpct_used !=
+ ctd.tcpct_cookie_desired * 2)
+ return -EINVAL;
+ if (ctd.tcpct_s_data_desired >
+ sysctl_tcp_syn_data_limit)
+ return -EINVAL;
+ }
+ } else if (TCPCT_OUT_DATA & ctd.tcpct_flags) {
+ /* unexpected flag without s_data */
+ return -EINVAL;
+ }
+
/* Allocate ancillary memory before locking.
*/
if (ctd.tcpct_used > 0 ||
@@ -2182,7 +2206,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
(sysctl_tcp_cookie_size > 0 ||
ctd.tcpct_cookie_desired > 0 ||
ctd.tcpct_s_data_desired > 0))) {
- cvp = kzalloc(sizeof(*cvp) + ctd.tcpct_used,
+ cvp = kzalloc(sizeof(*cvp) + s_data_used,
GFP_KERNEL);
if (cvp == NULL)
return -ENOMEM;
@@ -2191,7 +2215,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
}
lock_sock(sk);
tp->rx_opt.cookie_in_always =
- (TCP_COOKIE_IN_ALWAYS & ctd.tcpct_flags);
+ (TCPCT_IN_ALWAYS & ctd.tcpct_flags);
tp->rx_opt.cookie_out_never = 0; /* false */
if (tp->cookie_values != NULL) {
@@ -2210,11 +2234,27 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
if (cvp != NULL) {
cvp->cookie_desired = ctd.tcpct_cookie_desired;
- if (ctd.tcpct_used > 0) {
- memcpy(cvp->s_data_payload, ctd.tcpct_value,
- ctd.tcpct_used);
- cvp->s_data_desired = ctd.tcpct_used;
+ if (s_data_used > 0) {
+ if (copy_from_user(cvp->s_data_payload,
+ optval + sizeof(ctd),
+ s_data_used)) {
+ kref_put(&cvp->kref,
+ tcp_cookie_values_release);
+ return -EFAULT;
+ }
+ cvp->s_data_desired = s_data_used;
cvp->s_data_constant = 1; /* true */
+ } else if (ctd.tcpct_used > 0) {
+ if (copy_from_user(cvp->cookie_pair,
+ optval + sizeof(ctd),
+ ctd.tcpct_used)) {
+ kref_put(&cvp->kref,
+ tcp_cookie_values_release);
+ return -EFAULT;
+ }
+ /* No constant payload data. */
+ cvp->s_data_desired = ctd.tcpct_s_data_desired;
+ cvp->s_data_constant = 0; /* false */
} else {
/* No constant payload data. */
cvp->s_data_desired = ctd.tcpct_s_data_desired;
@@ -2574,7 +2614,7 @@ static int do_tcp_getsockopt(struct sock *sk, int level,
return 0;
case TCP_COOKIE_TRANSACTIONS: {
- struct tcp_cookie_transactions ctd;
+ struct tcpct_full ctd;
struct tcp_cookie_values *cvp = tp->cookie_values;
if (get_user(len, optlen))
@@ -2583,23 +2623,23 @@ static int do_tcp_getsockopt(struct sock *sk, int level,
return -EINVAL;
memset(&ctd, 0, sizeof(ctd));
- ctd.tcpct_flags = (tp->rx_opt.cookie_in_always ?
- TCP_COOKIE_IN_ALWAYS : 0)
- | (tp->rx_opt.cookie_out_never ?
- TCP_COOKIE_OUT_NEVER : 0);
+ ctd.soh.tcpct_flags = (tp->rx_opt.cookie_in_always ?
+ TCPCT_IN_ALWAYS : 0)
+ | (tp->rx_opt.cookie_out_never ?
+ TCPCT_OUT_NEVER : 0);
if (cvp != NULL) {
- ctd.tcpct_flags |= (cvp->s_data_in ?
- TCP_S_DATA_IN : 0)
- | (cvp->s_data_out ?
- TCP_S_DATA_OUT : 0);
+ ctd.soh.tcpct_flags |= (cvp->s_data_in ?
+ TCPCT_IN_DATA : 0)
+ | (cvp->s_data_out ?
+ TCPCT_OUT_DATA : 0);
- ctd.tcpct_cookie_desired = cvp->cookie_desired;
- ctd.tcpct_s_data_desired = cvp->s_data_desired;
+ ctd.soh.tcpct_cookie_desired = cvp->cookie_desired;
+ ctd.soh.tcpct_s_data_desired = cvp->s_data_desired;
memcpy(&ctd.tcpct_value[0], &cvp->cookie_pair[0],
cvp->cookie_pair_size);
- ctd.tcpct_used = cvp->cookie_pair_size;
+ ctd.soh.tcpct_used = cvp->cookie_pair_size;
}
if (put_user(sizeof(ctd), optlen))
--
1.7.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox