Re: [patch net-next 4/4] mlxsw: Introduce Mellanox SwitchX-2 ASIC support

2015-07-26 Thread Jiri Pirko
Sun, Jul 26, 2015 at 04:45:07AM CEST, sfel...@gmail.com wrote:
On Thu, Jul 23, 2015 at 8:43 AM, Jiri Pirko j...@resnulli.us wrote:
 From: Jiri Pirko j...@mellanox.com

 Benefit from the previously introduced Mellanox Switch infrastructure and
 add driver for SwitchX-2 ASIC. Note that this driver is very simple now.
 It implements bare minimum for getting device to work on slow-path.
 Fast-path offload functionality is going to be added soon.

 Signed-off-by: Jiri Pirko j...@mellanox.com
 Signed-off-by: Ido Schimmel ido...@mellanox.com
 Signed-off-by: Elad Raz el...@mellanox.com

[cut]

 +static netdev_tx_t mlxsw_sx_port_xmit(struct sk_buff *skb,
 + struct net_device *dev)
 +{
 +   struct mlxsw_sx_port *mlxsw_sx_port = netdev_priv(dev);
 +   struct mlxsw_sx *mlxsw_sx = mlxsw_sx_port-mlxsw_sx;
 +   struct mlxsw_sx_port_pcpu_stats *pcpu_stats;
 +   const struct mlxsw_tx_info tx_info = {
 +   .local_port = mlxsw_sx_port-local_port,
 +   .is_emad = false,
 +   };
 +   int err;
 +
 +   if (unlikely(skb_headroom(skb)  MLXSW_TXHDR_LEN)) {

Does this happen at all since dev-hard_header_len was set in probe to
add MLXSW_TXHDR_LEN?

This needs to be done for example for bridge forwarding case and other
forwarding cases.



 +   struct sk_buff *skb_new;
 +
 +   skb_new = skb_realloc_headroom(skb, MLXSW_TXHDR_LEN);
 +   dev_kfree_skb_any(skb);
 +   if (!skb_new) {
 +   this_cpu_inc(mlxsw_sx_port-pcpu_stats-tx_dropped);
 +   return NETDEV_TX_OK;
 +   }
 +   skb = skb_new;
 +   }
 +   mlxsw_sx_txhdr_construct(skb, tx_info);
 +   err = mlxsw_core_skb_transmit(mlxsw_sx, skb, tx_info);
 +   if (err == -EAGAIN)
 +   return NETDEV_TX_BUSY;

I think there is a problem here when returning NETDEV_TX_BUSY when
original skb might have been freed above in the headroom check. (ref
Documentation/networking/driver.txt).

I have to check this out a bit more. Thanks for pointing that out.



[cut]

 +static int mlxsw_sx_port_dev_addr_get(struct mlxsw_sx_port *mlxsw_sx_port)
 +{
 +   struct mlxsw_sx *mlxsw_sx = mlxsw_sx_port-mlxsw_sx;
 +   struct net_device *dev = mlxsw_sx_port-dev;
 +   char ppad_pl[MLXSW_REG_PPAD_LEN];
 +   int err;
 +
 +   mlxsw_reg_ppad_pack(ppad_pl, false, 0);
 +   err = mlxsw_reg_query(mlxsw_sx-core, MLXSW_REG(ppad), ppad_pl);
 +   if (err)
 +   return err;
 +   mlxsw_reg_ppad_mac_memcpy_from(ppad_pl, dev-dev_addr);
 +   /* The last byte in base mac address is always 0 */
 +   dev-dev_addr[ETH_ALEN - 1] += mlxsw_sx_port-local_port;

If MLXSW_PORT_MAX_PORTS  256, you'll wrap this.  Is dev_addr[ETH_ALEN
- 2] available to carry into?

That will never happen. MLXSW_PORT_MAX_PORTS is 0x40 and address got
from ppad register always ends with 0



 +   return 0;
 +}
 +

[cut]

 +static int mlxsw_sx_port_create(struct mlxsw_sx *mlxsw_sx, u8 local_port)
 +{
 +   struct mlxsw_sx_port *mlxsw_sx_port;
 +   struct net_device *dev;
 +   bool usable;
 +   int err;
 +
 +   dev = alloc_etherdev(sizeof(struct mlxsw_sx_port));
 +   if (!dev)
 +   return -ENOMEM;
 +   mlxsw_sx_port = netdev_priv(dev);
 +   mlxsw_sx_port-dev = dev;
 +   mlxsw_sx_port-mlxsw_sx = mlxsw_sx;
 +   mlxsw_sx_port-local_port = local_port;
 +
 +   mlxsw_sx_port-pcpu_stats =
 +   netdev_alloc_pcpu_stats(struct mlxsw_sx_port_pcpu_stats);
 +   if (!mlxsw_sx_port-pcpu_stats) {
 +   err = -ENOMEM;
 +   goto err_alloc_stats;
 +   }
 +
 +   dev-netdev_ops = mlxsw_sx_port_netdev_ops;
 +   dev-ethtool_ops = mlxsw_sx_port_ethtool_ops;
 +   dev-switchdev_ops = mlxsw_sx_port_switchdev_ops;
 +
 +   err = mlxsw_sx_port_dev_addr_get(mlxsw_sx_port);
 +   if (err) {
 +   dev_err(mlxsw_sx-bus_info-dev, Port %d: Unable to get 
 port mac address\n,
 +   mlxsw_sx_port-local_port);
 +   goto err_dev_addr_get;
 +   }
 +
 +   netif_carrier_off(dev);
 +
 +   dev-features |= NETIF_F_NETNS_LOCAL | NETIF_F_LLTX |

Not supposed to use LLTX in new drivers, according to
include/linux/netdev_features.h.

In our case, wee need to use this. Since multiple port netdevs may use
the same send dataqueue, we need to do locking ourselves.

Thanks for review!

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next] tcp: tso: allow deferring under reordering state

2015-07-26 Thread Eric Dumazet
From: Eric Dumazet eduma...@google.com

While doing experiments with reordering resilience, we found
linux senders were not able to send at full speed under reordering,
because every incoming SACK was releasing one MSS.

This patch removes the limitation, as we did for CWR state
in commit a0ea700e409 (tcp: tso: allow CA_CWR state in
tcp_tso_should_defer())

Neal Cardwell had a concern about limited transmit so
Yuchung conducted experiments on GFE and found nothing
worth adding an extra check on fast path :

  if (icsk-icsk_ca_state == TCP_CA_Disorder 
  tcp_sk(sk)-reordering == sysctl_tcp_reordering)
  goto send_now;

Signed-off-by: Eric Dumazet eduma...@google.com
Signed-off-by: Yuchung Cheng ych...@google.com
Cc: Neal Cardwell ncardw...@google.com
---
 net/ipv4/tcp_output.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 71057849593a..7d1efa762b75 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1774,7 +1774,7 @@ static bool tcp_tso_should_defer(struct sock *sk, struct 
sk_buff *skb,
if (TCP_SKB_CB(skb)-tcp_flags  TCPHDR_FIN)
goto send_now;
 
-   if (!((1  icsk-icsk_ca_state)  (TCPF_CA_Open | TCPF_CA_CWR)))
+   if (icsk-icsk_ca_state = TCP_CA_Recovery)
goto send_now;
 
/* Avoid bursty behavior by allowing defer


--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [ovs-dev] [PATCH net-next 3/3] openvswitch: 802.1AD: Flow handling, actions, and vlan parsing

2015-07-26 Thread ravulakollu.kumar
Hi Thomas,

Thank you very much for your response. 
Does this patch adds 802.1ad tag on ingress and pops the same on egress by 
default? or is it to be configured via ofctl commands 
explicitly?

Thanks in Advance,
Uday


From: Thomas F Herbert therb...@redhat.com
Sent: Sunday, July 26, 2015 8:03 PM
To: Ravulakollu Udaya Kumar (WT01 - Digital Marketing); 
thomasfherb...@gmail.com; pshe...@nicira.com
Cc: d...@openvswitch.org; netdev@vger.kernel.org
Subject: Re: [ovs-dev] [PATCH net-next 3/3] openvswitch: 802.1AD: Flow 
handling, actions, and vlan parsing

On 7/26/15 9:57 AM, ravulakollu.ku...@wipro.com wrote:
 Hi Thomas,

 I am currently using the beta version of ovs(2.3.90). In my phy-phy scenario  
 , I am configuring the two physical ports(eth0, eth1) attached to ovs bridge
 as trunk ports using the below commands.

 ovs-vsctl --no-wait add-port br0 eth0 vlan_mode=trunk
 ovs-vsctl --no-wait add-port br0 eth1 vlan_mode=trunk

 I configured the bridge to work in legacy mode as shown below

 $ ovs-ofctl dump-flows br0
 NXST_FLOW reply (xid=0x4):
 cookie=0x0, duration=15.458s, table=0, n_packets=0, n_bytes=0, idle_age=15, 
 priority=0 actions=NORMAL

 I tried sending 802.1ad tagged(outer tag tpid=0x88a8, inter tag tpid=ox8100) 
 packet from packetgen to phyport1 (eth0), and receiving back on 
 phyport2(eth2).
 When I captured the received packet on eth1 , the received packet is not same 
 as sent packet, means outer vlan TPID is not 0x88a8(instead 0x8100).

This patch supports pushing and popping of double tagged vlans. It
shouldn't affect double tagged traffic flowing through the switch unless
your ovs bridge has flows to pop or push a vlan.

Are you using tcpdump to look at the packets? There is a bug in libpcap
where the outer TPID of outgoing packets is miss-reported as 0x8100
whether or not the tpid is actually 0x88a8

 Could you please let me know , whether the below mentioned patch helps here.

 Thanks in Advance,
 Uday

 -Original Message-
 From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Thomas F Herbert
 Sent: Sunday, July 26, 2015 6:03 AM
 To: Pravin Shelar
 Cc: d...@openvswitch.org; netdev; therb...@redhat.com
 Subject: Re: [ovs-dev] [PATCH net-next 3/3] openvswitch: 802.1AD: Flow 
 handling, actions, and vlan parsing

 On 6/30/15 12:16 AM, Pravin Shelar wrote:
 On Tue, Jun 23, 2015 at 11:26 AM, Thomas F Herbert
 Pravin, I apologize because I realize now that I am finishing V12 of this 
 patch that I never responded to your comments in this email.
 thomasfherb...@gmail.com wrote:
 Add support for 802.1ad including the ability to push and pop double
 tagged vlans. Add support for 802.1ad to netlink parsing and flow
 conversion. Uses double nested encap attributes to represent double
 tagged vlan. Inner TPID encoded along with ctci in nested attributes.

 Signed-off-by: Thomas F Herbert thomasfherb...@gmail.com
 ---
net/openvswitch/flow.c |  84 +++---
net/openvswitch/flow.h |   5 ++
net/openvswitch/flow_netlink.c | 195 
 ++---
3 files changed, 242 insertions(+), 42 deletions(-)

 diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index
 2dacc7b..e268865 100644
 --- a/net/openvswitch/flow.c
 +++ b/net/openvswitch/flow.c
 @@ -298,21 +298,80 @@ static bool icmp6hdr_ok(struct sk_buff *skb)
static int parse_vlan(struct sk_buff *skb, struct sw_flow_key *key)
{
   struct qtag_prefix {
 -   __be16 eth_type; /* ETH_P_8021Q */
 +   __be16 eth_type; /* ETH_P_8021Q  or ETH_P_8021AD */
   __be16 tci;
   };
 -   struct qtag_prefix *qp;
 +   struct qtag_prefix *qp = (struct qtag_prefix *)skb-data;

 -   if (unlikely(skb-len  sizeof(struct qtag_prefix) + 
 sizeof(__be16)))
 +   struct qinqtag_prefix {
 +   __be16 eth_type; /* ETH_P_8021Q  or ETH_P_8021AD */
 +   __be16 tci;
 +   __be16 inner_tpid; /* ETH_P_8021Q */
 +   __be16 ctci;
 +   };
 +
 +   if (likely(skb_vlan_tag_present(skb))) {
 +   key-eth.tci = htons(skb-vlan_tci);
 +
 +   /* Case where upstream
 +* processing has already stripped the outer vlan tag.
 +*/
 +   if (unlikely(skb-vlan_proto == htons(ETH_P_8021AD))) {
 +   if (unlikely(skb-len  sizeof(struct qtag_prefix) +
 +   sizeof(__be16))) {
 +   key-eth.tci = 0;
 +   return 0;
 +   }
 +
 +   if (unlikely(!pskb_may_pull(skb,
 +   sizeof(struct 
 qtag_prefix) +
 +   sizeof(__be16 {
 +   return -ENOMEM;
 +   }
 +
 +   if (likely(qp-eth_type 

RE: [ovs-dev] [PATCH net-next 3/3] openvswitch: 802.1AD: Flow handling, actions, and vlan parsing

2015-07-26 Thread ravulakollu.kumar
Hi Thomas,

I am currently using the beta version of ovs(2.3.90). In my phy-phy scenario  , 
I am configuring the two physical ports(eth0, eth1) attached to ovs bridge
as trunk ports using the below commands.

ovs-vsctl --no-wait add-port br0 eth0 vlan_mode=trunk
ovs-vsctl --no-wait add-port br0 eth1 vlan_mode=trunk

I configured the bridge to work in legacy mode as shown below 

$ ovs-ofctl dump-flows br0
NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=15.458s, table=0, n_packets=0, n_bytes=0, idle_age=15, 
priority=0 actions=NORMAL

I tried sending 802.1ad tagged(outer tag tpid=0x88a8, inter tag tpid=ox8100) 
packet from packetgen to phyport1 (eth0), and receiving back on phyport2(eth2).
When I captured the received packet on eth1 , the received packet is not same 
as sent packet, means outer vlan TPID is not 0x88a8(instead 0x8100).

Could you please let me know , whether the below mentioned patch helps here. 

Thanks in Advance,
Uday 

-Original Message-
From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Thomas F Herbert
Sent: Sunday, July 26, 2015 6:03 AM
To: Pravin Shelar
Cc: d...@openvswitch.org; netdev; therb...@redhat.com
Subject: Re: [ovs-dev] [PATCH net-next 3/3] openvswitch: 802.1AD: Flow 
handling, actions, and vlan parsing

On 6/30/15 12:16 AM, Pravin Shelar wrote:
 On Tue, Jun 23, 2015 at 11:26 AM, Thomas F Herbert
Pravin, I apologize because I realize now that I am finishing V12 of this patch 
that I never responded to your comments in this email.
 thomasfherb...@gmail.com wrote:
 Add support for 802.1ad including the ability to push and pop double 
 tagged vlans. Add support for 802.1ad to netlink parsing and flow 
 conversion. Uses double nested encap attributes to represent double 
 tagged vlan. Inner TPID encoded along with ctci in nested attributes.

 Signed-off-by: Thomas F Herbert thomasfherb...@gmail.com
 ---
   net/openvswitch/flow.c |  84 +++---
   net/openvswitch/flow.h |   5 ++
   net/openvswitch/flow_netlink.c | 195 
 ++---
   3 files changed, 242 insertions(+), 42 deletions(-)

 diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index 
 2dacc7b..e268865 100644
 --- a/net/openvswitch/flow.c
 +++ b/net/openvswitch/flow.c
 @@ -298,21 +298,80 @@ static bool icmp6hdr_ok(struct sk_buff *skb)
   static int parse_vlan(struct sk_buff *skb, struct sw_flow_key *key)
   {
  struct qtag_prefix {
 -   __be16 eth_type; /* ETH_P_8021Q */
 +   __be16 eth_type; /* ETH_P_8021Q  or ETH_P_8021AD */
  __be16 tci;
  };
 -   struct qtag_prefix *qp;
 +   struct qtag_prefix *qp = (struct qtag_prefix *)skb-data;

 -   if (unlikely(skb-len  sizeof(struct qtag_prefix) + sizeof(__be16)))
 +   struct qinqtag_prefix {
 +   __be16 eth_type; /* ETH_P_8021Q  or ETH_P_8021AD */
 +   __be16 tci;
 +   __be16 inner_tpid; /* ETH_P_8021Q */
 +   __be16 ctci;
 +   };
 +
 +   if (likely(skb_vlan_tag_present(skb))) {
 +   key-eth.tci = htons(skb-vlan_tci);
 +
 +   /* Case where upstream
 +* processing has already stripped the outer vlan tag.
 +*/
 +   if (unlikely(skb-vlan_proto == htons(ETH_P_8021AD))) {
 +   if (unlikely(skb-len  sizeof(struct qtag_prefix) +
 +   sizeof(__be16))) {
 +   key-eth.tci = 0;
 +   return 0;
 +   }
 +
 +   if (unlikely(!pskb_may_pull(skb,
 +   sizeof(struct 
 qtag_prefix) +
 +   sizeof(__be16 {
 +   return -ENOMEM;
 +   }
 +
 +   if (likely(qp-eth_type == htons(ETH_P_8021Q))) {
 +   key-eth.cvlan.ctci =
 +   qp-tci | htons(VLAN_TAG_PRESENT);
 +   key-eth.cvlan.c_tpid = 
 + skb-vlan_proto;

 We should directly copy qp-inner_tpid here. As you have done it for 
 non offloaded case below.
Thanks! It is copied but it is set to the wrong tpid. The c_tpid field in the 
key should be set to the ethertype in the packet itself which is the inner 
tpid, not the offloaded skb-vlan_proto which is the outer tpid. Fixed in V12.

 +   __skb_pull(skb, sizeof(struct qtag_prefix));
 +   }
 +   }
  return 0;
 +   }

 -   if (unlikely(!pskb_may_pull(skb, sizeof(struct qtag_prefix) +
 -sizeof(__be16
 -   return -ENOMEM;

 -   qp = (struct qtag_prefix *) skb-data;
 -   key-eth.tci = qp-tci | htons(VLAN_TAG_PRESENT);
 -   __skb_pull(skb, sizeof(struct qtag_prefix));
 +   if 

Re: [ovs-dev] [PATCH net-next 3/3] openvswitch: 802.1AD: Flow handling, actions, and vlan parsing

2015-07-26 Thread Thomas F Herbert



On 7/26/15 9:57 AM, ravulakollu.ku...@wipro.com wrote:

Hi Thomas,

I am currently using the beta version of ovs(2.3.90). In my phy-phy scenario  , 
I am configuring the two physical ports(eth0, eth1) attached to ovs bridge
as trunk ports using the below commands.

ovs-vsctl --no-wait add-port br0 eth0 vlan_mode=trunk
ovs-vsctl --no-wait add-port br0 eth1 vlan_mode=trunk

I configured the bridge to work in legacy mode as shown below

$ ovs-ofctl dump-flows br0
NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=15.458s, table=0, n_packets=0, n_bytes=0, idle_age=15, 
priority=0 actions=NORMAL

I tried sending 802.1ad tagged(outer tag tpid=0x88a8, inter tag tpid=ox8100) 
packet from packetgen to phyport1 (eth0), and receiving back on phyport2(eth2).
When I captured the received packet on eth1 , the received packet is not same 
as sent packet, means outer vlan TPID is not 0x88a8(instead 0x8100).

This patch supports pushing and popping of double tagged vlans. It 
shouldn't affect double tagged traffic flowing through the switch unless 
your ovs bridge has flows to pop or push a vlan.


Are you using tcpdump to look at the packets? There is a bug in libpcap 
where the outer TPID of outgoing packets is miss-reported as 0x8100 
whether or not the tpid is actually 0x88a8



Could you please let me know , whether the below mentioned patch helps here.

Thanks in Advance,
Uday

-Original Message-
From: dev [mailto:dev-boun...@openvswitch.org] On Behalf Of Thomas F Herbert
Sent: Sunday, July 26, 2015 6:03 AM
To: Pravin Shelar
Cc: d...@openvswitch.org; netdev; therb...@redhat.com
Subject: Re: [ovs-dev] [PATCH net-next 3/3] openvswitch: 802.1AD: Flow 
handling, actions, and vlan parsing

On 6/30/15 12:16 AM, Pravin Shelar wrote:

On Tue, Jun 23, 2015 at 11:26 AM, Thomas F Herbert

Pravin, I apologize because I realize now that I am finishing V12 of this patch 
that I never responded to your comments in this email.

thomasfherb...@gmail.com wrote:

Add support for 802.1ad including the ability to push and pop double
tagged vlans. Add support for 802.1ad to netlink parsing and flow
conversion. Uses double nested encap attributes to represent double
tagged vlan. Inner TPID encoded along with ctci in nested attributes.

Signed-off-by: Thomas F Herbert thomasfherb...@gmail.com
---
   net/openvswitch/flow.c |  84 +++---
   net/openvswitch/flow.h |   5 ++
   net/openvswitch/flow_netlink.c | 195 
++---
   3 files changed, 242 insertions(+), 42 deletions(-)

diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index
2dacc7b..e268865 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -298,21 +298,80 @@ static bool icmp6hdr_ok(struct sk_buff *skb)
   static int parse_vlan(struct sk_buff *skb, struct sw_flow_key *key)
   {
  struct qtag_prefix {
-   __be16 eth_type; /* ETH_P_8021Q */
+   __be16 eth_type; /* ETH_P_8021Q  or ETH_P_8021AD */
  __be16 tci;
  };
-   struct qtag_prefix *qp;
+   struct qtag_prefix *qp = (struct qtag_prefix *)skb-data;

-   if (unlikely(skb-len  sizeof(struct qtag_prefix) + sizeof(__be16)))
+   struct qinqtag_prefix {
+   __be16 eth_type; /* ETH_P_8021Q  or ETH_P_8021AD */
+   __be16 tci;
+   __be16 inner_tpid; /* ETH_P_8021Q */
+   __be16 ctci;
+   };
+
+   if (likely(skb_vlan_tag_present(skb))) {
+   key-eth.tci = htons(skb-vlan_tci);
+
+   /* Case where upstream
+* processing has already stripped the outer vlan tag.
+*/
+   if (unlikely(skb-vlan_proto == htons(ETH_P_8021AD))) {
+   if (unlikely(skb-len  sizeof(struct qtag_prefix) +
+   sizeof(__be16))) {
+   key-eth.tci = 0;
+   return 0;
+   }
+
+   if (unlikely(!pskb_may_pull(skb,
+   sizeof(struct qtag_prefix) +
+   sizeof(__be16 {
+   return -ENOMEM;
+   }
+
+   if (likely(qp-eth_type == htons(ETH_P_8021Q))) {
+   key-eth.cvlan.ctci =
+   qp-tci | htons(VLAN_TAG_PRESENT);
+   key-eth.cvlan.c_tpid =
+ skb-vlan_proto;


We should directly copy qp-inner_tpid here. As you have done it for
non offloaded case below.

Thanks! It is copied but it is set to the wrong tpid. The c_tpid field in the 
key should be set to the ethertype in the packet itself which is the inner 
tpid, not the offloaded skb-vlan_proto which is the outer tpid. Fixed in V12.



+   __skb_pull(skb, sizeof(struct qtag_prefix));
+   }
+ 

Re: [patch net-next 2/4] mlxsw: Add PCI bus implementation

2015-07-26 Thread Jiri Pirko
Sun, Jul 26, 2015 at 07:15:04AM CEST, sfel...@gmail.com wrote:
On Thu, Jul 23, 2015 at 8:43 AM, Jiri Pirko j...@resnulli.us wrote:
 From: Jiri Pirko j...@mellanox.com

 Add PCI bus implementation for Mellanox Technologies Switch ASICs. This
 includes firmware initialization, async queues manipulation and command
 interface implementation.

 Signed-off-by: Jiri Pirko j...@mellanox.com
 Signed-off-by: Ido Schimmel ido...@mellanox.com
 Signed-off-by: Elad Raz el...@mellanox.com
 ---

[cut]

 +static int mlxsw_pci_fw_area_init(struct mlxsw_pci *mlxsw_pci, char *mbox,
 + u16 num_pages)
 +{
 +   struct mlxsw_pci_mem_item *mem_item;
 +   int i;
 +   int err;

Need to init err to zero here

You are right. We need to set err before goto err_alloc. Thanks.



 +
 +   mlxsw_pci-fw_area.items = kcalloc(num_pages, sizeof(*mem_item),
 +  GFP_KERNEL);
 +   if (!mlxsw_pci-fw_area.items)
 +   return -ENOMEM;
 +   mlxsw_pci-fw_area.num_pages = num_pages;
 +
 +   mlxsw_cmd_mbox_zero(mbox);
 +   for (i = 0; i  num_pages; i++) {
 +   mem_item = mlxsw_pci-fw_area.items[i];
 +
 +   mem_item-size = MLXSW_PCI_PAGE_SIZE;
 +   mem_item-buf = pci_alloc_consistent(mlxsw_pci-pdev,
 +mem_item-size,
 +mem_item-mapaddr);
 +   if (!mem_item-buf)
 +   goto err_alloc;
 +   mlxsw_cmd_mbox_map_fa_pa_set(mbox, i, mem_item-mapaddr);
 +   mlxsw_cmd_mbox_map_fa_log2size_set(mbox, i, 0); /* 1 page */
 +   }
 +
 +   err = mlxsw_cmd_map_fa(mlxsw_pci-core, mbox, num_pages);
 +   if (err)
 +   goto err_cmd_map_fa;
 +
 +   return 0;
 +
 +err_cmd_map_fa:
 +err_alloc:
 +   for (i--; i = 0; i--) {
 +   mem_item = mlxsw_pci-fw_area.items[i];
 +
 +   pci_free_consistent(mlxsw_pci-pdev, mem_item-size,
 +   mem_item-buf, mem_item-mapaddr);
 +   }
 +   kfree(mlxsw_pci-fw_area.items);
 +   return err;
 +}
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] brcmfmac: dhd_sdio.c: use existing atomic_or primitive

2015-07-26 Thread Arend van Spriel

On 07/24/2015 07:22 PM, Vineet Gupta wrote:

On Friday 24 July 2015 08:02 PM, Kalle Valo wrote:

Vineet Gupta vineet.gup...@synopsys.com writes:


There's already a generic implementation so use that instead.
---
I'm not sure if the driver usage of atomic_or?() is correct in terms of
storage size of @val for 64 bit arches.

Assuming LP64 programming model for linux on say x86_64: atomic_or()
callers in this driver use long (sana 64 bit) storage and pass it to
atomic_orr/atomic_or which downcasts it to 32 bits. Is that OK ?
---
Cc: Brett Rudley brud...@broadcom.com
Cc: Arend van Spriel ar...@broadcom.com
Cc: Franky (Zhenhui) Lin fran...@broadcom.com
Cc: Hante Meuleman meule...@broadcom.com
Cc: Kalle Valo kv...@codeaurora.org
Cc: Pieter-Paul Giesberts piete...@broadcom.com
Cc: Daniel Kim de...@broadcom.com
Cc: linux-wirel...@vger.kernel.org
Cc: brcm80211-dev-l...@broadcom.com
Cc: Peter Zijlstra pet...@infradead.org
Cc: Ingo Molnar mi...@kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-a...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Vineet Gupta vgu...@synopsys.com

Signed-off-by: Vineet Gupta vgu...@synopsys.com

What's the plan with this patch? Should I take it to my
wireless-drivers-next tree or will someone else take it?



Per last discussion on this topic, Arend wanted to discuss abt this with Hante.
I'm not taking it anyways so feel free to pick it up if you want !


Well, that was before your timeline clarification about the generic 
function. One what tree is this patch based?


Regards,
Arend
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv6 RFT] net: fec: Ensure clocks are enabled while using mdio bus

2015-07-26 Thread Andrew Lunn
On Sat, Jul 25, 2015 at 10:38:02PM +0200, Andrew Lunn wrote:
 When a switch is attached to the mdio bus, the mdio bus can be used
 while the interface is not open. If the IPG clock is not enabled, MDIO
 reads/writes will simply time out.

Hi David

Now there are two tested-by's could you pick this patch up?

Or do you want a repost including the tested-by's?

Thanks
Andrew
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next]r8169:Correct size from dma_alloc_coherent Maximum size register with size argument from dma_alloc_coherent old variable R8169_RX_RING_BYTES return to much value 17000 instead

2015-07-26 Thread Corcodel Marian
Signed-off-by: Corcodel Marian corcodel.mar...@gmail.com
---
 drivers/net/ethernet/realtek/r8169.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c 
b/drivers/net/ethernet/realtek/r8169.c
index 3df51fa..561c23a 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -5200,6 +5200,7 @@ static void rtl_set_rx_tx_desc_registers(struct 
rtl8169_private *tp,
 * register to be written before TxDescAddrLow to work.
 * Switching from MMIO to I/O access fixes the issue as well.
 */
+   
RTL_W32(TxDescStartAddrHigh, ((u64) tp-TxPhyAddr)  32);
RTL_W32(TxDescStartAddrLow, ((u64) tp-TxPhyAddr)  DMA_BIT_MASK(32));
RTL_W32(RxDescAddrHigh, ((u64) tp-RxPhyAddr)  32);
@@ -6724,8 +6725,8 @@ static int rtl8169_init_ring(struct net_device *dev)
 
rtl8169_init_ring_indexes(tp);
 
-   memset(tp-tx_skb, 0x0, NUM_TX_DESC * sizeof(struct ring_info));
-   memset(tp-Rx_databuff, 0x0, NUM_RX_DESC * sizeof(void *));
+   memset(tp-tx_skb, 0x0, NUM_RX_DESC);
+   memset(tp-Rx_databuff, 0x0, NUM_RX_DESC);
 
return rtl8169_rx_fill(tp);
 }
@@ -7555,7 +7556,7 @@ static int rtl8169_close(struct net_device *dev)
 
free_irq(pdev-irq, dev);
 
-   dma_free_coherent(pdev-dev, R8169_RX_RING_BYTES, tp-RxDescArray,
+   dma_free_coherent(pdev-dev, rx_buf_sz, tp-RxDescArray,
  tp-RxPhyAddr);
dma_free_coherent(pdev-dev, R8169_TX_RING_BYTES, tp-TxDescArray,
  tp-TxPhyAddr);
@@ -7594,7 +7595,7 @@ static int rtl_open(struct net_device *dev)
if (!tp-TxDescArray)
goto err_pm_runtime_put;
 
-   tp-RxDescArray = dma_alloc_coherent(pdev-dev, R8169_RX_RING_BYTES,
+   tp-RxDescArray = dma_alloc_coherent(pdev-dev, rx_buf_sz,
 tp-RxPhyAddr, GFP_KERNEL);
if (!tp-RxDescArray)
goto err_free_tx_0;
@@ -7644,7 +7645,7 @@ err_release_fw_2:
rtl_release_firmware(tp);
rtl8169_rx_clear(tp);
 err_free_rx_1:
-   dma_free_coherent(pdev-dev, R8169_RX_RING_BYTES, tp-RxDescArray,
+   dma_free_coherent(pdev-dev, rx_buf_sz, tp-RxDescArray,
  tp-RxPhyAddr);
tp-RxDescArray = NULL;
 err_free_tx_0:
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH iproute2] Replace BSD MAXPATHLEN by POSIX PATH_MAX

2015-07-26 Thread Felix Janda
Prefer using the POSIX constant PATH_MAX instead of the legacy BSD
derived MAXPATHLEN. The necessary includes for MAXPATHLEN and PATH_MAX
are sys/param.h and limits.h, respectively.

Signed-off-by: Felix Janda felix.ja...@posteo.de
---
This patch is identical except for title and commit message to the one
with title Use PATH_MAX instead of MAXPATHLEN.
---
 ip/ipnetns.c| 15 +++
 lib/namespace.c | 11 ++-
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/ip/ipnetns.c b/ip/ipnetns.c
index 0c28f8a..3b704a4 100644
--- a/ip/ipnetns.c
+++ b/ip/ipnetns.c
@@ -4,7 +4,6 @@
 #include sys/wait.h
 #include sys/inotify.h
 #include sys/mount.h
-#include sys/param.h
 #include sys/syscall.h
 #include stdio.h
 #include string.h
@@ -437,7 +436,7 @@ static int is_pid(const char *str)
 static int netns_pids(int argc, char **argv)
 {
const char *name;
-   char net_path[MAXPATHLEN];
+   char net_path[PATH_MAX];
int netns;
struct stat netst;
DIR *dir;
@@ -472,7 +471,7 @@ static int netns_pids(int argc, char **argv)
return -1;
}
while((entry = readdir(dir))) {
-   char pid_net_path[MAXPATHLEN];
+   char pid_net_path[PATH_MAX];
struct stat st;
if (!is_pid(entry-d_name))
continue;
@@ -493,7 +492,7 @@ static int netns_pids(int argc, char **argv)
 static int netns_identify(int argc, char **argv)
 {
const char *pidstr;
-   char net_path[MAXPATHLEN];
+   char net_path[PATH_MAX];
int netns;
struct stat netst;
DIR *dir;
@@ -537,7 +536,7 @@ static int netns_identify(int argc, char **argv)
}
 
while((entry = readdir(dir))) {
-   char name_path[MAXPATHLEN];
+   char name_path[PATH_MAX];
struct stat st;
 
if (strcmp(entry-d_name, .) == 0)
@@ -563,7 +562,7 @@ static int netns_identify(int argc, char **argv)
 
 static int on_netns_del(char *nsname, void *arg)
 {
-   char netns_path[MAXPATHLEN];
+   char netns_path[PATH_MAX];
 
snprintf(netns_path, sizeof(netns_path), %s/%s, NETNS_RUN_DIR, 
nsname);
umount2(netns_path, MNT_DETACH);
@@ -612,7 +611,7 @@ static int netns_add(int argc, char **argv)
 * userspace tweaks like remounting /sys, or bind mounting
 * a new /etc/resolv.conf can be shared between uers.
 */
-   char netns_path[MAXPATHLEN];
+   char netns_path[PATH_MAX];
const char *name;
int fd;
int made_netns_run_dir_mount = 0;
@@ -707,7 +706,7 @@ static int set_netnsid_from_name(const char *name, int nsid)
 
 static int netns_set(int argc, char **argv)
 {
-   char netns_path[MAXPATHLEN];
+   char netns_path[PATH_MAX];
const char *name;
int netns, nsid;
 
diff --git a/lib/namespace.c b/lib/namespace.c
index c03a103..a61feb6 100644
--- a/lib/namespace.c
+++ b/lib/namespace.c
@@ -9,15 +9,16 @@
 
 #include fcntl.h
 #include dirent.h
+#include limits.h
 
 #include utils.h
 #include namespace.h
 
 static void bind_etc(const char *name)
 {
-   char etc_netns_path[MAXPATHLEN];
-   char netns_name[MAXPATHLEN];
-   char etc_name[MAXPATHLEN];
+   char etc_netns_path[PATH_MAX];
+   char netns_name[PATH_MAX];
+   char etc_name[PATH_MAX];
struct dirent *entry;
DIR *dir;
 
@@ -43,7 +44,7 @@ static void bind_etc(const char *name)
 
 int netns_switch(char *name)
 {
-   char net_path[MAXPATHLEN];
+   char net_path[PATH_MAX];
int netns;
 
snprintf(net_path, sizeof(net_path), %s/%s, NETNS_RUN_DIR, name);
@@ -87,7 +88,7 @@ int netns_switch(char *name)
 
 int netns_get_fd(const char *name)
 {
-   char pathbuf[MAXPATHLEN];
+   char pathbuf[PATH_MAX];
const char *path, *ptr;
 
path = name;
-- 
2.3.6
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next V12 0/3] openvswitch: Add support for 802.1AD

2015-07-26 Thread Thomas F Herbert
V12: Fix some problems and issues pointed out by reviewers. When parsing
netlink attributes Ether types other then 0x88a8 as outer tpid.

V11: Add inner tpid to flow key. Fix separate inner encap attribute
when parsing netlink attributes. Merge 2 patches to consolidate
qinq changes.

V10: Implement reviewer comments: Consolidate vlan parsing functions.
Splits netlink parsing and flow conversion into a separate patch. Uses
double encap attribute encapsulation for 802.1ad.  Netlink attributes
now look like this:

eth_type(0x88a8),vlan(vid=100),encap(eth_type(0x8100), vlan(vid=200),
encap(eth_type(0x0800), ...))

The double encap atributes in this version of the patch is incompatible with
old versions of the user level 802.1ad patch. A new user level patch which
is also being submitted simultaneously to openvswitch dev mailing list.

V9:  Includes changes suggested by reviewers

V8:  Includes changes suggested by reviewers

V7:  Includes changes suggested by reviewers

V6:  Rebased to net-next

V5:  Use encapsulated attributes

Although the Open Flow specification specified support for 802.1AD (qinq)
as well as push and pop vlan headers,  So far Open vSwitch has only
supported a single tag header.

This patch accompanies version 10 of the user level openvswitch patch
submitted to openvswitch dev list.
For discussion, history  and previous versions of the kernel module
patch and the user code patch see the OVS dev mailing list,
openvswitch.org/pipermail/dev/..


Thomas F Herbert (3):
  openvswitch: 802.1ad uapi changes.
  Check for vlan ethernet types for 8021.q or 802.1ad
  802.1AD: Flow handling, actions, vlan parsing and netlink attributes

 include/linux/if_vlan.h  |  17 
 include/uapi/linux/openvswitch.h |  17 ++--
 net/openvswitch/flow.c   |  84 ++---
 net/openvswitch/flow.h   |   5 +
 net/openvswitch/flow_netlink.c   | 196 +--
 5 files changed, 269 insertions(+), 50 deletions(-)

-- 
2.4.3

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next V12 2/3] Check for vlan ethernet types for 8021.q or 802.1ad

2015-07-26 Thread Thomas F Herbert
Signed-off-by: Thomas F Herbert thomasfherb...@gmail.com
---
 include/linux/if_vlan.h | 17 +
 1 file changed, 17 insertions(+)

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 67ce5bd..88d1be4 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -627,6 +627,23 @@ static inline netdev_features_t vlan_features_check(const 
struct sk_buff *skb,
 
return features;
 }
+/**
+ * eth_type_vlan - check for valid vlan ether type.
+ * @ethertype: ether type to check
+ *
+ * Returns true if the ether type is a vlan ether type.
+ */
+static inline bool eth_type_vlan(__be16 ethertype)
+{
+   switch (ethertype) {
+   case (htons(ETH_P_8021Q)):
+   return true;
+   case (htons(ETH_P_8021AD)):
+   return true;
+   default:
+   return false;
+   }
+}
 
 /**
  * compare_vlan_header - Compare two vlan headers
-- 
2.4.3

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next 3/3] openvswitch: 802.1AD: Flow handling, actions, vlan parsing and netlink attributes

2015-07-26 Thread Thomas F Herbert
Add support for 802.1ad including the ability to push and pop double
tagged vlans. Add support for 802.1ad to netlink parsing and flow
conversion. Uses double nested encap attributes to represent double
tagged vlan. Inner TPID encoded along with ctci in nested attributes. Allows
either 0x8100 or 0x88a8 on inner or outer tags.

Signed-off-by: Thomas F Herbert thomasfherb...@gmail.com
---
 net/openvswitch/flow.c |  84 +++---
 net/openvswitch/flow.h |   5 ++
 net/openvswitch/flow_netlink.c | 196 ++---
 3 files changed, 243 insertions(+), 42 deletions(-)

diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index 8db22ef..0abab37 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -298,21 +298,80 @@ static bool icmp6hdr_ok(struct sk_buff *skb)
 static int parse_vlan(struct sk_buff *skb, struct sw_flow_key *key)
 {
struct qtag_prefix {
-   __be16 eth_type; /* ETH_P_8021Q */
+   __be16 eth_type; /* ETH_P_8021Q  or ETH_P_8021AD */
__be16 tci;
};
-   struct qtag_prefix *qp;
+   struct qtag_prefix *qp = (struct qtag_prefix *)skb-data;
 
-   if (unlikely(skb-len  sizeof(struct qtag_prefix) + sizeof(__be16)))
+   struct qinqtag_prefix {
+   __be16 eth_type; /* ETH_P_8021Q  or ETH_P_8021AD */
+   __be16 tci;
+   __be16 inner_tpid; /* ETH_P_8021Q */
+   __be16 ctci;
+   };
+
+   if (likely(skb_vlan_tag_present(skb))) {
+   key-eth.tci = htons(skb-vlan_tci);
+
+   /* Case where upstream
+* processing has already stripped the outer vlan tag.
+*/
+   if (unlikely(skb-vlan_proto == htons(ETH_P_8021AD))) {
+   if (unlikely(skb-len  sizeof(struct qtag_prefix) +
+   sizeof(__be16))) {
+   key-eth.tci = 0;
+   return 0;
+   }
+
+   if (unlikely(!pskb_may_pull(skb,
+   sizeof(struct qtag_prefix) +
+   sizeof(__be16 {
+   return -ENOMEM;
+   }
+
+   if (likely(qp-eth_type == htons(ETH_P_8021Q))) {
+   key-eth.cvlan.ctci =
+   qp-tci | htons(VLAN_TAG_PRESENT);
+   key-eth.cvlan.c_tpid = qp-eth_type;
+   __skb_pull(skb, sizeof(struct qtag_prefix));
+   }
+   }
return 0;
+   }
 
-   if (unlikely(!pskb_may_pull(skb, sizeof(struct qtag_prefix) +
-sizeof(__be16
-   return -ENOMEM;
 
-   qp = (struct qtag_prefix *) skb-data;
-   key-eth.tci = qp-tci | htons(VLAN_TAG_PRESENT);
-   __skb_pull(skb, sizeof(struct qtag_prefix));
+   if (qp-eth_type == htons(ETH_P_8021AD)) {
+   struct qinqtag_prefix *qinqp =
+   (struct qinqtag_prefix *)skb-data;
+
+   if (unlikely(skb-len  sizeof(struct qinqtag_prefix) +
+   sizeof(__be16)))
+   return 0;
+
+   if (unlikely(!pskb_may_pull(skb, sizeof(struct qinqtag_prefix) +
+   sizeof(__be16 {
+   return -ENOMEM;
+   }
+   key-eth.tci = qinqp-tci | htons(VLAN_TAG_PRESENT);
+   key-eth.cvlan.ctci = qinqp-ctci | htons(VLAN_TAG_PRESENT);
+   key-eth.cvlan.c_tpid = qinqp-inner_tpid;
+
+   __skb_pull(skb, sizeof(struct qinqtag_prefix));
+
+   return 0;
+   }
+   if (qp-eth_type == htons(ETH_P_8021Q)) {
+   if (unlikely(skb-len  sizeof(struct qtag_prefix) +
+   sizeof(__be16)))
+   return -ENOMEM;
+
+   if (unlikely(!pskb_may_pull(skb, sizeof(struct qtag_prefix) +
+   sizeof(__be16
+   return 0;
+   key-eth.tci = qp-tci | htons(VLAN_TAG_PRESENT);
+
+   __skb_pull(skb, sizeof(struct qtag_prefix));
+   }
 
return 0;
 }
@@ -474,9 +533,10 @@ static int key_extract(struct sk_buff *skb, struct 
sw_flow_key *key)
 */
 
key-eth.tci = 0;
-   if (skb_vlan_tag_present(skb))
-   key-eth.tci = htons(skb-vlan_tci);
-   else if (eth-h_proto == htons(ETH_P_8021Q))
+   key-eth.cvlan.ctci = 0;
+   key-eth.cvlan.c_tpid = 0;
+   if ((skb_vlan_tag_present(skb)) ||
+   eth_type_vlan(eth-h_proto))
if (unlikely(parse_vlan(skb, key)))
return -ENOMEM;
 
diff --git 

[PATCH] net/ipv4: suppress NETDEV_UP notification on address lifetime update

2015-07-26 Thread David Ward
This notification causes the FIB to be updated, which is not needed
because the address already exists, and more importantly it may undo
intentional changes that were made to the FIB after the address was
originally added. (As a point of comparison, when an address becomes
deprecated because its preferred lifetime expired, a notification on
this chain is not generated.)

The motivation for this commit is fixing an incompatibility between
DHCP clients which set and update the address lifetime according to
the lease, and a commercial VPN client which replaces kernel routes
in a way that outbound traffic is sent only through the tunnel (and
disconnects if any further route changes are detected via netlink).

Signed-off-by: David Ward david.w...@ll.mit.edu
---
 net/ipv4/devinet.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index e813196..2d9cb17 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -882,7 +882,6 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct 
nlmsghdr *nlh)
queue_delayed_work(system_power_efficient_wq,
check_lifetime_work, 0);
rtmsg_ifa(RTM_NEWADDR, ifa, nlh, NETLINK_CB(skb).portid);
-   blocking_notifier_call_chain(inetaddr_chain, NETDEV_UP, ifa);
}
return 0;
 }
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch net-next 4/4] mlxsw: Introduce Mellanox SwitchX-2 ASIC support

2015-07-26 Thread Jiri Pirko
snip




 +   struct sk_buff *skb_new;
 +
 +   skb_new = skb_realloc_headroom(skb, MLXSW_TXHDR_LEN);
 +   dev_kfree_skb_any(skb);
 +   if (!skb_new) {
 +   this_cpu_inc(mlxsw_sx_port-pcpu_stats-tx_dropped);
 +   return NETDEV_TX_OK;
 +   }
 +   skb = skb_new;
 +   }
 +   mlxsw_sx_txhdr_construct(skb, tx_info);
 +   err = mlxsw_core_skb_transmit(mlxsw_sx, skb, tx_info);
 +   if (err == -EAGAIN)
 +   return NETDEV_TX_BUSY;

I think there is a problem here when returning NETDEV_TX_BUSY when
original skb might have been freed above in the headroom check. (ref
Documentation/networking/driver.txt).

I have to check this out a bit more. Thanks for pointing that out.

You are right. In case queue is busy we obviously cannot free
the original skb. Will fix that in V2. Thanks!
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] r8169: correct size from ... (snip)

2015-07-26 Thread Francois Romieu
Corcodel Marian corcodel.mar...@gmail.com :
[...]
 @@ -7594,7 +7595,7 @@ static int rtl_open(struct net_device *dev)
   if (!tp-TxDescArray)
   goto err_pm_runtime_put;
  
 - tp-RxDescArray = dma_alloc_coherent(pdev-dev, R8169_RX_RING_BYTES,
 + tp-RxDescArray = dma_alloc_coherent(pdev-dev, rx_buf_sz,
tp-RxPhyAddr, GFP_KERNEL);

1. RxDescArray is the descriptor ring. It does not care about rx_buf_sz.

2. I don't see how R8169_RX_RING_BYTES could reach 17000:

#define NUM_RX_DESC 256U/* Number of Rx descriptor registers */
[...]
#define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc))
[...]
struct RxDesc {
__le32 opts1;
__le32 opts2;   
__le64 addr;
};

256 * 16 = 4096

3. The Subject: field should not include the verbose change description.

-- 
Ueimor
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v1 net-next 1/1] net: fec: add stop mode request on/off implemention

2015-07-26 Thread David Miller
From: Fugang Duan b38...@freescale.com
Date: Wed, 22 Jul 2015 18:13:43 +0800

 The current driver depends on platform data to implement stop mode
 request on/off that call api pdata-sleep_mode_enable().
 
 To reduce arch platform redundancy code, since the function only set
 SOC GPR register bit to request stop mode of/off, so we can move the
 function into driver. And the specifix GPR register offset and MASK
 bit can be transferred from DTS.
 
 Signed-off-by: Fugang Duan b38...@freescale.com

Doesn't this break stop mode on those devices until the DTS is
updated?

That's really unfortunate, because you're leaving all of the platform
data and implementation there, yet it's going to be unused.

I really think you need to keep the code using the platform data bits
around until all the DTSs are updated.

No matter what you tell me about how DTSs are updated (don't even
mention the details, I do not care) you simply cannot keep the
platform data code around and not use it.  It is completely
nonsensible to have code that would properly function and properly
support a feature for the device in the kernel, yet not use it.

Period.

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 03/10] dpaa_eth: add configurable bpool thresholds

2015-07-26 Thread David Miller
From: Madalin-Cristian Bucur madalin.bu...@freescale.com
Date: Fri, 24 Jul 2015 15:49:39 +

 -Original Message-
 From: Joe Perches [mailto:j...@perches.com]
 On Wed, 2015-07-22 at 19:16 +0300, Madalin Bucur wrote:
  Allow the user to tweak the refill threshold and the total number
  of buffers in the buffer pool. The provided values are for one CPU.
 
 Any value in making these module parameters instead?
 
 I expect one would (hardly ever) change these to improve some corner
 cases then use them with the new values. It may help in the tuning process
 but afterwards the bloat to the bootcmd would probably be  a nuisance.

I think these should be controlled by the existing ethtool infrastructure.

Neither the Kconfig mechanism nor module parameters are appropriate, at all.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] net: switchdev: restrict vid range abstraction

2015-07-26 Thread Vivien Didelot
This patch replaces the vid_begin and vid_end members of the
switchdev_obj_vlan structure for a single vid member. This way, the VID
range abstraction is restricted to switchdev, not exposed to drivers.

The main benefice to do so is to allow the prepare phase to be called
for each VID, not only once for the whole range.

For example, when adding VLANs 2-5, a switch chip may not be able to add
hardware VLAN 2 due to some bridge restriction (thus must return
-EOPNOTSUPP), while VLAN 3-5 are allowed.

Also, moving the iteration code to switchdev simplifies its
implementation and its drivers code (e.g. Rocker).

Signed-off-by: Vivien Didelot vivien.dide...@savoirfairelinux.com
---
 drivers/net/ethernet/rocker/rocker.c | 74 ++--
 include/net/switchdev.h  |  3 +-
 net/bridge/br_vlan.c |  6 +--
 net/switchdev/switchdev.c| 70 +-
 4 files changed, 58 insertions(+), 95 deletions(-)

diff --git a/drivers/net/ethernet/rocker/rocker.c 
b/drivers/net/ethernet/rocker/rocker.c
index 7b4c347..f0dfd77 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -4366,41 +4366,25 @@ static int rocker_port_attr_set(struct net_device *dev,
 }
 
 static int rocker_port_vlan_add(struct rocker_port *rocker_port,
-   enum switchdev_trans trans, u16 vid, u16 flags)
+   enum switchdev_trans trans,
+   const struct switchdev_obj_vlan *vlan)
 {
int err;
 
/* XXX deal with flags for PVID and untagged */
 
-   err = rocker_port_vlan(rocker_port, trans, 0, vid);
+   err = rocker_port_vlan(rocker_port, trans, 0, vlan-vid);
if (err)
return err;
 
-   err = rocker_port_router_mac(rocker_port, trans, 0, htons(vid));
+   err = rocker_port_router_mac(rocker_port, trans, 0, htons(vlan-vid));
if (err)
rocker_port_vlan(rocker_port, trans,
-ROCKER_OP_FLAG_REMOVE, vid);
+ROCKER_OP_FLAG_REMOVE, vlan-vid);
 
return err;
 }
 
-static int rocker_port_vlans_add(struct rocker_port *rocker_port,
-enum switchdev_trans trans,
-const struct switchdev_obj_vlan *vlan)
-{
-   u16 vid;
-   int err;
-
-   for (vid = vlan-vid_begin; vid = vlan-vid_end; vid++) {
-   err = rocker_port_vlan_add(rocker_port, trans,
-  vid, vlan-flags);
-   if (err)
-   return err;
-   }
-
-   return 0;
-}
-
 static int rocker_port_fdb_add(struct rocker_port *rocker_port,
   enum switchdev_trans trans,
   const struct switchdev_obj_fdb *fdb)
@@ -4434,8 +4418,8 @@ static int rocker_port_obj_add(struct net_device *dev,
 
switch (obj-id) {
case SWITCHDEV_OBJ_PORT_VLAN:
-   err = rocker_port_vlans_add(rocker_port, obj-trans,
-   obj-u.vlan);
+   err = rocker_port_vlan_add(rocker_port, obj-trans,
+  obj-u.vlan);
break;
case SWITCHDEV_OBJ_IPV4_FIB:
fib4 = obj-u.ipv4_fib;
@@ -4455,32 +4439,17 @@ static int rocker_port_obj_add(struct net_device *dev,
 }
 
 static int rocker_port_vlan_del(struct rocker_port *rocker_port,
-   u16 vid, u16 flags)
+   const struct switchdev_obj_vlan *vlan)
 {
int err;
 
err = rocker_port_router_mac(rocker_port, SWITCHDEV_TRANS_NONE,
-ROCKER_OP_FLAG_REMOVE, htons(vid));
+ROCKER_OP_FLAG_REMOVE, htons(vlan-vid));
if (err)
return err;
 
return rocker_port_vlan(rocker_port, SWITCHDEV_TRANS_NONE,
-   ROCKER_OP_FLAG_REMOVE, vid);
-}
-
-static int rocker_port_vlans_del(struct rocker_port *rocker_port,
-const struct switchdev_obj_vlan *vlan)
-{
-   u16 vid;
-   int err;
-
-   for (vid = vlan-vid_begin; vid = vlan-vid_end; vid++) {
-   err = rocker_port_vlan_del(rocker_port, vid, vlan-flags);
-   if (err)
-   return err;
-   }
-
-   return 0;
+   ROCKER_OP_FLAG_REMOVE, vlan-vid);
 }
 
 static int rocker_port_fdb_del(struct rocker_port *rocker_port,
@@ -4505,7 +4474,7 @@ static int rocker_port_obj_del(struct net_device *dev,
 
switch (obj-id) {
case SWITCHDEV_OBJ_PORT_VLAN:
-   err = rocker_port_vlans_del(rocker_port, obj-u.vlan);
+   err = rocker_port_vlan_del(rocker_port, obj-u.vlan);
break;
case SWITCHDEV_OBJ_IPV4_FIB:
fib4 = 

RE: [PATCH v2.1 21/22] fjes: handle receive cancellation request interrupt

2015-07-26 Thread Izumi, Taku
Hi Sergei,

 Thanks for revewing.

 -Original Message-
 From: Sergei Shtylyov [mailto:sergei.shtyl...@cogentembedded.com]
 Sent: Thursday, July 23, 2015 10:06 PM
 To: Izumi, Taku/泉 拓; netdev@vger.kernel.org; da...@davemloft.net
 Cc: platform-driver-...@vger.kernel.org; dvh...@infradead.org; 
 rk...@redhat.com; alexander.h.du...@redhat.com;
 linux-a...@vger.kernel.org; j...@perches.com; step...@networkplumber.org; 
 yasu.isim...@gmail.com
 Subject: Re: [PATCH v2.1 21/22] fjes: handle receive cancellation request 
 interrupt
 
 Hello.
 
 On 7/23/2015 3:10 AM, Taku Izumi wrote:
 
  This patch adds implementation of handling IRQ
  of other receiver's receive cancellation request.
 
  Signed-off-by: Taku Izumi izumi.t...@jp.fujitsu.com
  ---
drivers/net/fjes/fjes_main.c | 79 
  
1 file changed, 79 insertions(+)
 
  diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
  index faaf2ed..b21ad68 100644
  --- a/drivers/net/fjes/fjes_main.c
  +++ b/drivers/net/fjes/fjes_main.c
  @@ -822,6 +822,75 @@ static int fjes_vlan_rx_kill_vid(struct net_device 
  *netdev,
  return 0;
}
 
  +static void fjes_txrx_stop_req_irq(struct fjes_adapter *adapter,
  +  int src_epid)
  +{
  +   struct fjes_hw *hw = adapter-hw;
  +   enum ep_partner_status status;
  +
  +   status = fjes_hw_get_partner_ep_status(hw, src_epid);
  +   switch (status) {
  +   case EP_PARTNER_UNSHARE:
  +   default:
  +   break;
  +   case EP_PARTNER_COMPLETE:
  +   break;
 
 Why this *case* isn't merged with the above ones?

  Oh... You are right.

 
  +   case EP_PARTNER_WAITING:
  +   if (src_epid  hw-my_epid) {
  +   hw-ep_shm_info[src_epid].tx.info-v1i.rx_status |=
  +   FJES_RX_STOP_REQ_DONE;
  +
  +   clear_bit(src_epid, hw-txrx_stop_req_bit);
  +   set_bit(src_epid, adapter-unshare_watch_bitmask);
  +
  +   if (!work_pending(adapter-unshare_watch_task))
  +   queue_work(adapter-control_wq,
  +  adapter-unshare_watch_task);
  +   }
  +   break;
  +   case EP_PARTNER_SHARED:
  +   if (hw-ep_shm_info[src_epid].rx.info-v1i.rx_status
  +FJES_RX_STOP_REQ_REQUEST) {
 
 Please leave the  operator on the first line and start the second line
 right under 'hw' on the first.

   OK.
 
 [...]
 
 MBR, Sergei

 Sincerely,
 Taku Izumi
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v1 net-next 1/1] net: fec: add stop mode request on/off implemention

2015-07-26 Thread Duan Andy
From: David Miller da...@davemloft.net Sent: Monday, July 27, 2015 7:27 AM
 To: Duan Fugang-B38611
 Cc: netdev@vger.kernel.org; Li Frank-B20596; step...@networkplumber.org
 Subject: Re: [PATCH v1 net-next 1/1] net: fec: add stop mode request
 on/off implemention
 
 From: Fugang Duan b38...@freescale.com
 Date: Wed, 22 Jul 2015 18:13:43 +0800
 
  The current driver depends on platform data to implement stop mode
  request on/off that call api pdata-sleep_mode_enable().
 
  To reduce arch platform redundancy code, since the function only set
  SOC GPR register bit to request stop mode of/off, so we can move the
  function into driver. And the specifix GPR register offset and MASK
  bit can be transferred from DTS.
 
  Signed-off-by: Fugang Duan b38...@freescale.com
 
 Doesn't this break stop mode on those devices until the DTS is updated?
 
 That's really unfortunate, because you're leaving all of the platform
 data and implementation there, yet it's going to be unused.
 
 I really think you need to keep the code using the platform data bits
 around until all the DTSs are updated.
 
 No matter what you tell me about how DTSs are updated (don't even mention
 the details, I do not care) you simply cannot keep the platform data code
 around and not use it.  It is completely nonsensible to have code that
 would properly function and properly support a feature for the device in
 the kernel, yet not use it.
 
 Period.

Thanks for your comments.

Firstly, I will send some board dts patches (and test).
Secondly, the net/next tree have no platform data for stop mode because others 
suggest us to use dts not platform data, and there have no any boards support 
stop mode in net/next, so this doesn't break any boards in net/next.

Regards,
Andy
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] openvswitch: fix compilation when vxlan is a module

2015-07-26 Thread David Miller
From: Nicolas Dichtel nicolas.dich...@6wind.com
Date: Thu, 23 Jul 2015 11:29:07 +0200

 With CONFIG_VXLAN=m and CONFIG_OPENVSWITCH=y, there was the following
 compilation error:
   LD  init/built-in.o
   net/built-in.o: In function `vxlan_tnl_create':
   .../net/openvswitch/vport-netdev.c:322: undefined reference to 
 `vxlan_dev_create'
   make: *** [vmlinux] Error 1
 
 CC: Thomas Graf tg...@suug.ch
 Fixes: 614732eaa12d (openvswitch: Use regular VXLAN net_device device)
 Signed-off-by: Nicolas Dichtel nicolas.dich...@6wind.com

Applied as a stop-gap measure to fix this, but this is a terrible
dependency.

There is no reason a user should have to know that without vxlan
they aren't able to turn on openvswitch.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] ipv4: be more aggressive when probing alternative gateways

2015-07-26 Thread David Miller
From: Julian Anastasov j...@ssi.bg
Date: Thu, 23 Jul 2015 10:39:35 +0300

 Currently, we do not notice if new alternative gateways
 are added. We can do it by checking for present neigh
 entry. Also, gateways that are currently probed (NUD_INCOMPLETE)
 can be skipped from round-robin probing.
 
 Suggested-by: Florian Westphal f...@strlen.de
 Signed-off-by: Julian Anastasov j...@ssi.bg

Applied.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] bridge: mdb: notify on router port add and del

2015-07-26 Thread David Miller
From: Nikolay Aleksandrov niko...@cumulusnetworks.com
Date: Thu, 23 Jul 2015 05:00:53 -0700

 From: Satish Ashok sas...@cumulusnetworks.com
 
 Send notifications on router port add and del/expire, re-use the already
 existing MDBA_ROUTER and send NEWMDB/DELMDB netlink notifications
 respectively.
 
 Signed-off-by: Satish Ashok sas...@cumulusnetworks.com
 Signed-off-by: Nikolay Aleksandrov niko...@cumulusnetworks.com

Applied, thanks.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] openvswitch: Retrieve tunnel metadata when receiving from vport-netdev

2015-07-26 Thread David Miller
From: Thomas Graf tg...@suug.ch
Date: Thu, 23 Jul 2015 13:04:44 +0200

 Retrieve the tunnel metadata for packets received by a net_device and
 provide it to ovs_vport_receive() for flow key extraction.
 
 [This hunk was in the GRE patch in the initial series and missed the
  cut for the initial submission for merging.]
 
 Fixes: 614732eaa12d (openvswitch: Use regular VXLAN net_device device)
 Signed-off-by: Thomas Graf tg...@suug.ch

Applied, thanks.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] net: via/Kconfig: GENERIC_PCI_IOMAP required if PCI not selected

2015-07-26 Thread David Miller
From: Antonio Borneo borneo.anto...@gmail.com
Date: Thu, 23 Jul 2015 09:35:51 +0800

 Digging in git log, arch that used to provide such empty instances
 moved to a centralized implementation by using GENERIC_PCI_IOMAP.
 For me such empty functions should be available by default when PCI is
 not set, but this is not the case today.

Then that is what we should fix instead of these hackish per-driver
patches.

Make it so that these fallback implementations always are present
when PCI is not set.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] cxgb4: Allow firmware flash, only if cxgb4 is the master driver

2015-07-26 Thread David Miller
From: Hariprasad Shenai haripra...@chelsio.com
Date: Wed, 22 Jul 2015 22:54:50 +0530

 Adapter can go for a toss, if cxgb4 is loaded as slave and we try to
 upgrade the firmware. So add a check for the same before flashing
 firmware using ethtool.
 
 Signed-off-by: Hariprasad Shenai haripra...@chelsio.com

Applied, thanks.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] lwtunnel: export linux/lwtunnel.h to userspace

2015-07-26 Thread David Miller
From: Nicolas Dichtel nicolas.dich...@6wind.com
Date: Thu, 23 Jul 2015 15:43:56 +0200

 Note also that include/linux/lwtunnel.h is not needed.
 
 CC: Thomas Graf tg...@suug.ch
 CC: Roopa Prabhu ro...@cumulusnetworks.com
 Fixes: 499a24256862 (lwtunnel: infrastructure for handling light weight 
 tunnels like mpls)
 Signed-off-by: Nicolas Dichtel nicolas.dich...@6wind.com

Applied, thanks.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] cxgb4vf: Read correct FL congestion threshold for T5 and T6

2015-07-26 Thread David Miller
From: Hariprasad Shenai haripra...@chelsio.com
Date: Thu, 23 Jul 2015 22:41:14 +0530

 VF driver was reading incorrect freelist congestion notification threshold
 for FLM queues when packing is enabled for T5 and T6 adapter. Fixing it
 now.
 
 Signed-off-by: Hariprasad Shenai haripra...@chelsio.com

Applied, thanks.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next]r8169:Correct size from dma_alloc_coherent Maximum size register with size argument from dma_alloc_coherent old variable R8169_RX_RING_BYTES return to much value 17000 instead of v

2015-07-26 Thread David Miller

This, again, is improperly submitted.

Again, your entire commit message is in the subject line and this is
not what we want.

This constant wave of badly formed patch submissions is extremely
frustrating, and whether you realise it or not your improper
submissions are consuming a large amount of valuable developer time.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V2 net-next 1/1] hv_netvsc: Wait for sub-channels to be processed during probe

2015-07-26 Thread David Miller
From: K. Y. Srinivasan k...@microsoft.com
Date: Wed, 22 Jul 2015 11:42:32 -0700

 The current code returns from probe without waiting for the proper handling
 of subchannels that may be requested. If the netvsc driver were to be rapidly
 loaded/unloaded, we can  trigger a panic as the unload will be tearing
 down state that may not have been fully setup yet. We fix this issue by making
 sure that we return from the probe call only after ensuring that the
 sub-channel offers in flight are properly handled.
 
 Reviewed-and-tested-by: Haiyang Zhang haiya...@microsoft.com
 Signed-off-by: K. Y. Srinivasan k...@microsoft.com

Applied, thanks.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] af_mpls: fix undefined reference to ip6_route_output

2015-07-26 Thread David Miller
From: roopa ro...@cumulusnetworks.com
Date: Thu, 23 Jul 2015 06:44:13 -0700

 On 7/23/15, 12:09 AM, David Miller wrote:
 From: roopa ro...@cumulusnetworks.com
 Date: Wed, 22 Jul 2015 13:38:31 -0700

 I cant think of a way to fix the current problem with my patch...
 I guess it's not obvious that adding CONFIG_MPLS_IPV6 would solve
 the problem perfectly.
 I thought that was not an option because CONFIG_MPLS_ROUTING is
 already out and supports IPV6 when RTA_OIF is
 specified.
 
 I did submit another version yesterday using IS_BUILTIN (sorry missed
 the v2 in the patch prefix).
 https://patchwork.ozlabs.org/patch/498903/
 
 I can certainly introduce CONFIG_MPLS_IPV6, if that is a more
 acceptable.

Also, IS_BUILTIN() is the wrong check, because this works properly also
when both MPLS_ROUTING and IPV6 are modular.

You need to encode this in the Kconfig dependencies of a new option
(which uses the dependency expression IPV6 || IPV6=n), then you can
key off of that Kconfig symbol to determine whether you need to
provide those NOP fallbacks or not.  There really is no other option.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v2] net: bcmgenet: Remove checks on clock handles

2015-07-26 Thread David Miller
From: Florian Fainelli f.faine...@gmail.com
Date: Wed, 22 Jul 2015 17:28:23 -0700

 Instead of multiplying the number of checks for IS_ERR(priv-clk),
 simply NULLify the 'struct clk' pointer which is something the Linux
 common clock framework perfectly deals with and does early return for
 each and every single clk_* API functions.
 
 Having every single function check for !IS_ERR(priv-clk) is both
 redundant and error prone, as it turns out, we were doing it for the
 main GENET clock: priv-clk, but not for the Wake-on-LAN or EEE clock,
 so let's just be consistent here.
 
 Signed-off-by: Florian Fainelli f.faine...@gmail.com
 ---
 Changes in v2:
 
 - remove all IS_ERR() checks as described, there were two missing in v1

Ahh, here it is :-)

Applied, thanks.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net 0/4] inet: ip defrag bug fixes

2015-07-26 Thread David Miller
From: Florian Westphal f...@strlen.de
Date: Thu, 23 Jul 2015 12:05:36 +0200

 Johan Schuijt and Frank Schreuder reported crash and softlockup after the
 inet workqueue eviction change:
 
 general protection fault:  [#1] SMP
 CPU: 0 PID: 4 Comm: kworker/0:0 Not tainted 3.18.18-transip-1.5 #1
 Workqueue: events inet_frag_worker
 task: 880224935130 ti: 880224938000 task.ti: 880224938000
 RIP: 0010:[8149288c] [8149288c] 
 inet_evict_bucket+0xfc/0x160
 RSP: 0018:88022493bd58  EFLAGS: 00010286
 RAX: 88021f4f3e80 RBX: dead00100100 RCX: 006b
 RDX: 006c RSI: 88021f4f3e80 RDI: dead001000a8
 RBP: 0002 R08: 88073900 R09: 880036e49200
 R10: 8800c6e86500 R11: 880036f45500 R12: 81a87100
 R13: 88022493bd70 R14:  R15: 8800c9b26280
 [..]
 Call Trace:
  [814929e0] ? inet_frag_worker+0x60/0x210
  [8107e3a2] ? process_one_work+0x142/0x3b0
  [8107eb94] ? worker_thread+0x114/0x440
 [..]
 
 A second issue results in softlockup since the evictor may restart the
 eviction loop for a (potentially) unlimited number of times while local
 softirqs are disabled.
 
 Frank reports that test system remained stable for 14 hours of testing
 (before, crash occured within half an hour in their setup).

Looks great, series applied, thanks everyone.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Patch v2 resend 2/2] net: fec: introduce fec_ptp_stop and use in probe fail path

2015-07-26 Thread David Miller
From: Lucas Stach l.st...@pengutronix.de
Date: Thu, 23 Jul 2015 16:06:20 +0200

 This function frees resources and cancels delayed work item that
 have been initialized in fec_ptp_init().
 
 Use this to do proper error handling if something goes wrong in
 probe function after fec_ptp_init has been called.
 
 Signed-off-by: Lucas Stach l.st...@pengutronix.de
 Acked-by: Fugang Duan b38...@freescale.com

Applied.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Patch v2 resend 1/2] net: fec: use managed DMA API functions to allocate BD ring

2015-07-26 Thread David Miller
From: Lucas Stach l.st...@pengutronix.de
Date: Thu, 23 Jul 2015 16:06:19 +0200

 So it gets freed when the device is going away.
 This fixes a DMA memory leak on driver probe() fail and driver
 remove().
 
 Signed-off-by: Lucas Stach l.st...@pengutronix.de
 ---
 v2: Fix indentation of second line to fix alignment with opening bracket.

Applied.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V3 net-next 0/5] net: implement SMC-R solution

2015-07-26 Thread David Miller
From: Ursula Braun ubr...@linux.vnet.ibm.com
Date: Wed, 22 Jul 2015 10:59:47 +0200

 1. Provides optimized performance compared to standard TCP/IP over Ethernet
within the data center for both request/response (latency) and streaming
workloads (CPU savings) [3]. 
Initial benchmarks on Linux on x86 processors have shown latency
reduction of up to 52% with a throughput gain of 111% using SMC-R vs TCP
for request/response message patterns (10 concurrent TCP connections
with 16KBmessages) and CPU savings of up to 69% for streaming data
patterns (single TCP connection with 20MB of data in one direction).
[1] is currently updated to contain more detailed information on Linux
and performance.

I'm really sorry but this is the same rabbit hole and set of claims
that have been bullhorned my way for RDMA over the years and I still
don't buy it.

None of the RDMA'ish proponents ever talk about what you _don't_ get
when this stuff triggers.

No netfilter.

No packet scheduler.

No classifier actions.

No BPF.

No bridging.

Basically, every single interesting feature of the Linux networking
goes away once this RDMA thing happens.

Furthermore the benchmarks are carefully choosen to exemplify the
perfect environment for this feature to excell at.

Sorry, I don't want any of this in our core networking stack.  You'll
have to support this completely outside of the TCP implementation and
core networking code, and therefore have it %100 in your own separate
module with your own can of worms like the Infiniband et al. people
do.

Having this standardized or in widespread successful use has no
bearing upon the things I do not like about this patch set, so do not
use those kinds of arguments to try and change my mind.  It won't
work.

I'm not applying this patch series.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net 0/4] mlx4 driver fixes, July 22nd 2015

2015-07-26 Thread David Miller
From: Or Gerlitz ogerl...@mellanox.com
Date: Wed, 22 Jul 2015 16:53:45 +0300

 Just few mlx4 fixes.. the fix related to propagating port state
 changes to VF should go to -stable of = 3.11, all the rest just
 to 4.2-rc

Series applied and patch #2 queued up for -stable, thanks.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next 0/3] tipc: clean up socket message reception

2015-07-26 Thread David Miller
From: Jon Maloy jon.ma...@ericsson.com
Date: Wed, 22 Jul 2015 10:11:17 -0400

 Despite recent improvements the message reception code in socket.c is
 perceived as obscure and hard to follow, especially regarding the logics
 for message rejection. With the commits in this series we try to remedy
 this situation.

Series applied, thanks Jon.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: pull request: bluetooth 2015-07-23

2015-07-26 Thread David Miller
From: Johan Hedberg johan.hedb...@gmail.com
Date: Thu, 23 Jul 2015 18:17:22 +0300

 Here's another one-patch pull request for 4.2 which targets a potential
 NULL pointer dereference in the LE Security Manager code that can be
 triggered by using older user space tools. The issue has been there
 since 4.0 so there's the appropriate Cc: stable in place.
 
 Let me know if there are any issues pulling. Thanks.

Pulled, thanks Johan.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net] bridge: netlink: fix slave_changelink/br_setport race conditions

2015-07-26 Thread David Miller
From: Nikolay Aleksandrov ra...@blackwall.org
Date: Wed, 22 Jul 2015 13:03:40 +0200

 From: Nikolay Aleksandrov niko...@cumulusnetworks.com
 
 Since slave_changelink support was added there have been a few race
 conditions when using br_setport() since some of the port functions it
 uses require the bridge lock. It is very easy to trigger a lockup due to
 some internal spin_lock() usage without bh disabled, also it's possible to
 get the bridge into an inconsistent state.
 
 Signed-off-by: Nikolay Aleksandrov niko...@cumulusnetworks.com
 Fixes: 3ac636b8591c (bridge: implement rtnl_link_ops-slave_changelink)

Applied and queued up for -stable, thanks.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net] net: sctp: stop spamming klog with rfc6458, 5.3.2. deprecation warnings

2015-07-26 Thread David Miller
From: Daniel Borkmann dan...@iogearbox.net
Date: Wed, 22 Jul 2015 16:31:49 +0200

 Back then when we added support for SCTP_SNDINFO/SCTP_RCVINFO from
 RFC6458 5.3.4/5.3.5, we decided to add a deprecation warning for the
 (as per RFC deprecated) SCTP_SNDRCV via commit bbbea41d5e53 (net:
 sctp: deprecate rfc6458, 5.3.2. SCTP_SNDRCV support), see [1].
 
 Imho, it was not a good idea, and we should just revert that message
 for a couple of reasons:
 
   1) It's uapi and therefore set in stone forever.
 
   2) To be able to run on older and newer kernels, an SCTP application
  would need to probe for both, SCTP_SNDRCV, but also SCTP_SNDINFO/
  SCTP_RCVINFO support, so that on older kernels, it can make use
  of SCTP_SNDRCV, and on newer kernels SCTP_SNDINFO/SCTP_RCVINFO.
  In my (limited) experience, a lot of SCTP appliances are migrating
  to newer kernels only ve(ee)ry slowly.
 
   3) Some people don't have the chance to change their applications,
  f.e. due to proprietary legacy stuff. So, they'll hit this warning
  in fast path and are stuck with older kernels.
 
 But i.e. due to point 1) I really fail to see the benefit of a warning.
 So just revert that for now, the issue was reported up Jamal.
 
   [1] http://thread.gmane.org/gmane.linux.network/321960/
 
 Reported-by: Jamal Hadi Salim j...@mojatatu.com
 Signed-off-by: Daniel Borkmann dan...@iogearbox.net

Applied, thanks Daniel.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] vxlan: Use proper endian type for vni in vxlan[6]_xmit_skb

2015-07-26 Thread David Miller
From: Thomas Graf tg...@suug.ch
Date: Wed, 22 Jul 2015 17:08:42 +0200

 Silences the following sparse warnings:
 drivers/net/vxlan.c:1818:21: warning: incorrect type in assignment (different 
 base types)
 drivers/net/vxlan.c:1818:21:expected restricted __be32 [usertype] vx_vni
 drivers/net/vxlan.c:1818:21:got unsigned int [unsigned] [usertype] vni
 drivers/net/vxlan.c:2014:58: warning: incorrect type in argument 11 
 (different base types)
 drivers/net/vxlan.c:2014:58:expected unsigned int [unsigned] [usertype] 
 vni
 drivers/net/vxlan.c:2014:58:got restricted __be32 [usertype] noident
 
 Fixes: 614732eaa12d (openvswitch: Use regular VXLAN net_device device)
 Reported-by: kbuild test robot fengguang...@intel.com
 Signed-off-by: Thomas Graf tg...@suug.ch

Applied, thanks.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next 1/1] Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver

2015-07-26 Thread David Miller
From: woojung@microchip.com
Date: Wed, 22 Jul 2015 19:01:44 +

 - remove module param which can be configurable by standard mechanism.

You still left some unacceptable module parameters in here.

The only one which is fine is the debug level setting, that's
it.

There is no way in I'm applying a patch that allows programming
registers of the chip directly via module parameters, no way.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] net: bcmgenet: Remove checks on clock handles

2015-07-26 Thread David Miller
From: Florian Fainelli f.faine...@gmail.com
Date: Wed, 22 Jul 2015 15:11:54 -0700

 Instead of multiplying the number of checks for IS_ERR(priv-clk),
 simply NULLify the 'struct clk' pointer which is something the Linux
 common clock framework perfectly deals with and does early return for
 each and every single clk_* API functions.
 
 Having every single function check for !IS_ERR(priv-clk) is both
 redundant and error prone, as it turns out, we were doing it for the
 main GENET clock: priv-clk, but not for the Wake-on-LAN or EEE clock,
 so let's just be consistent here.
 
 Signed-off-by: Florian Fainelli f.faine...@gmail.com

My understanding is that you will be posting a new version of this
patch updating the cases in bcmgenet_probe() that Patri pointed out.

Right?
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] ipv6: fix crash over flow-based vxlan device

2015-07-26 Thread David Miller
From: Wei-Chun Chao weich...@plumgrid.com
Date: Wed, 22 Jul 2015 18:13:12 -0700

 Similar check was added in ip_rcv but not in ipv6_rcv.
 
 BUG: unable to handle kernel NULL pointer dereference at (null)
 IP: [81734e0a] ipv6_rcv+0xfa/0x500
 Call Trace:
 [816c9786] ? ip_rcv+0x296/0x400
 [817732d2] ? packet_rcv+0x52/0x410
 [8168e99f] __netif_receive_skb_core+0x63f/0x9a0
 [c02b34a0] ? br_handle_frame_finish+0x580/0x580 [bridge]
 [8109912c] ? update_rq_clock.part.81+0x1c/0x40
 [8168ed18] __netif_receive_skb+0x18/0x60
 [8168fa1f] process_backlog+0x9f/0x150
 
 Fixes: ee122c79d422 (vxlan: Flow based tunneling)
 Signed-off-by: Wei-Chun Chao weich...@plumgrid.com

Applied, thank you.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] net: bcmgenet: Register link_update callback for all MoCA PHYs

2015-07-26 Thread David Miller
From: Florian Fainelli f.faine...@gmail.com
Date: Wed, 22 Jul 2015 17:29:53 -0700

 Commit 8d88c6ebb34c (net: bcmgenet: enable MoCA link state change
 detection) added a fixed PHY link_update callback for MoCA PHYs when
 registered using platform_data exclusively, this change is also
 applicable to systems using Device Tree as their primary configuration
 interface.
 
 In order for this to work, move the link_update assignment into
 bcmgenet_moca_phy_setup() where we know for sure that we are running on
 a MoCA GENET instance, and do not override phydev-link since this is:
 
 - properly taken care of by the PHY library by getting the link UP/DOWN
   interrupts
 - this now runs everytime we call bcmgenet_open(), so we need to
   preserve whatever we detected before we went administratively DOWN and
   then UP
 - we need to make sure that MoCA PHYs start with a link DOWN during
   probe in order to force a link transition to occur
 
 To avoid a forward declaration, move bcmgenet_fixed_phy_link_update()
 above its caller.
 
 Signed-off-by: Florian Fainelli f.faine...@gmail.com

Applied.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [NET-NEXT PATCH] net: macb: Change capability mask of jumbo support

2015-07-26 Thread David Miller
From: Harini Katakam harini.kata...@xilinx.com
Date: Thu, 23 Jul 2015 15:31:26 +0530

 Capability mask for jumbo and no gigabit half duplex is the same.
 Change one of them.
 
 Signed-off-by: Harini Katakam hari...@xilinx.com

Applied, thanks.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch net] niu: don't count tx error twice in case of headroom realloc fails

2015-07-26 Thread David Miller
From: Jiri Pirko j...@resnulli.us
Date: Thu, 23 Jul 2015 12:20:37 +0200

 Fixes: a3138df9 ([NIU]: Add Sun Neptune ethernet driver.)
 Signed-off-by: Jiri Pirko j...@resnulli.us

Applied, thank you.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] rsi: Fix failure to load firmware after memory leak fix and fix the leak

2015-07-26 Thread Mike Looijmans
Fixes commit eae79b4f3e82ca63a53478a161b190a0d38fe526 (rsi: fix memory leak
in rsi_load_ta_instructions()) which stopped the driver from functioning.

Firmware data has been allocated using vmalloc(), resulting in memory
that cannot be used for DMA. Hence the firmware was first copied to a
buffer allocated with kmalloc() in the original code. This patch reverts
the commit and only calls kfree() to release the buffer after sending
the data. This fixes the memory leak without breaking the driver.

Add a comment to the kmemdup() calls to explain why this is done.

Tested on a Topic Miami-Florida board which contains the rsi SDIO chip.

Also added the same kfree() call to the USB glue driver. This was not
tested on actual hardware though, as I only have the SDIO version.

Signed-off-by: Mike Looijmans mike.looijm...@topic.nl
Cc: sta...@vger.kernel.org
---
 drivers/net/wireless/rsi/rsi_91x_sdio_ops.c | 6 +-
 drivers/net/wireless/rsi/rsi_91x_usb_ops.c  | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c 
b/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
index b6cc9ff..5c37a71 100644
--- a/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
+++ b/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
@@ -172,6 +172,7 @@ static int rsi_load_ta_instructions(struct rsi_common 
*common)
(struct rsi_91x_sdiodev *)adapter-rsi_dev;
u32 len;
u32 num_blocks;
+   const u8 *fw;
const struct firmware *fw_entry = NULL;
u32 block_size = dev-tx_blk_size;
int status = 0;
@@ -200,6 +201,8 @@ static int rsi_load_ta_instructions(struct rsi_common 
*common)
return status;
}
 
+   /* Copy firmware into DMA-accessible memory */
+   fw = kmemdup(fw_entry-data, fw_entry-size, GFP_KERNEL);
len = fw_entry-size;
 
if (len % 4)
@@ -210,7 +213,8 @@ static int rsi_load_ta_instructions(struct rsi_common 
*common)
rsi_dbg(INIT_ZONE, %s: Instruction size:%d\n, __func__, len);
rsi_dbg(INIT_ZONE, %s: num blocks: %d\n, __func__, num_blocks);
 
-   status = rsi_copy_to_card(common, fw_entry-data, len, num_blocks);
+   status = rsi_copy_to_card(common, fw, len, num_blocks);
+   kfree(fw);
release_firmware(fw_entry);
return status;
 }
diff --git a/drivers/net/wireless/rsi/rsi_91x_usb_ops.c 
b/drivers/net/wireless/rsi/rsi_91x_usb_ops.c
index 1106ce7..088e28e 100644
--- a/drivers/net/wireless/rsi/rsi_91x_usb_ops.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb_ops.c
@@ -146,6 +146,7 @@ static int rsi_load_ta_instructions(struct rsi_common 
*common)
return status;
}
 
+   /* Copy firmware into DMA-accessible memory */
fw = kmemdup(fw_entry-data, fw_entry-size, GFP_KERNEL);
len = fw_entry-size;
 
@@ -158,6 +159,7 @@ static int rsi_load_ta_instructions(struct rsi_common 
*common)
rsi_dbg(INIT_ZONE, %s: num blocks: %d\n, __func__, num_blocks);
 
status = rsi_copy_to_card(common, fw, len, num_blocks);
+   kfree(fw);
release_firmware(fw_entry);
return status;
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next] tcp: tso: allow deferring under reordering state

2015-07-26 Thread Neal Cardwell
On Sun, Jul 26, 2015 at 3:45 AM, Eric Dumazet eric.duma...@gmail.com wrote:
 From: Eric Dumazet eduma...@google.com

 While doing experiments with reordering resilience, we found
 linux senders were not able to send at full speed under reordering,
 because every incoming SACK was releasing one MSS.

 This patch removes the limitation, as we did for CWR state
 in commit a0ea700e409 (tcp: tso: allow CA_CWR state in
 tcp_tso_should_defer())

 Neal Cardwell had a concern about limited transmit so
 Yuchung conducted experiments on GFE and found nothing
 worth adding an extra check on fast path :

   if (icsk-icsk_ca_state == TCP_CA_Disorder 
   tcp_sk(sk)-reordering == sysctl_tcp_reordering)
   goto send_now;

 Signed-off-by: Eric Dumazet eduma...@google.com
 Signed-off-by: Yuchung Cheng ych...@google.com
 Cc: Neal Cardwell ncardw...@google.com

Acked-by: Neal Cardwell ncardw...@google.com

Looks good to me. Thanks, Eric. And thanks, Yuchung, for running the experiment!

neal
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][kernel 2.6.32] Bond interface can't send gratuitous ARP

2015-07-26 Thread Willy Tarreau
Hi Qingjie,

On Mon, Jul 27, 2015 at 09:05:29AM +0800, ? wrote:
 Hi,
 
 Bond interface worked as Active-Backup mode.
 If the bond interface was added in bridge, then it's just a port of bridge.
 It doesn' have IP address.
 When bond slave changing, the current code bond_send_gratuitous_arp
 didn't take effect. It couldn't send gratuitous ARP.
 So I made a patch to fix this issue.
 
 It's my first patch for kernel.
 
 Thanks a lot for your *understanding* for any *inconvenience* caused.

Patches may only be sent for mainline kernel. Since you're trying to fix
2.6.32, you first need to check if a more recent version works properly.
If it's the case, then instead you should ask for a backport of the patch
that did the related change (it's easier for tracking bug fixes and
regressions). If the problem is also present in mainline, then you should
propose your patch for mainline. Since it's a fix, it will be backported.

BTW, please keep in mind that 2.6.32 is reaching EOL in a few months, so
it would be a good time to try newer ones (3.2 or 3.4 are rock solid now).

Hoping this helps,
Willy

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html