Netdev List
 help / color / mirror / Atom feed
* [PATCH] bonding: change error message to debug message in __bond_release_one()
From: Wengang Wang @ 2014-12-23  1:24 UTC (permalink / raw)
  To: netdev, gospo, dingtianhong; +Cc: wen.gang.wang

In __bond_release_one(), when the interface is not a slave or not a slave of
"this" master, it log error message.

The message actually should be a debug message matching what bond_enslave()
does.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
---
 drivers/net/bonding/bond_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 184c434..0dceba1 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1648,7 +1648,7 @@ static int __bond_release_one(struct net_device *bond_dev,
 	/* slave is not a slave or master is not master of this slave */
 	if (!(slave_dev->flags & IFF_SLAVE) ||
 	    !netdev_has_upper_dev(slave_dev, bond_dev)) {
-		netdev_err(bond_dev, "cannot release %s\n",
+		netdev_dbg(bond_dev, "cannot release %s\n",
 			   slave_dev->name);
 		return -EINVAL;
 	}
-- 
1.8.3.1

^ permalink raw reply related

* Re: [PATCH net] net: Generalize ndo_gso_check to ndo_features_check
From: Tom Herbert @ 2014-12-23  1:28 UTC (permalink / raw)
  To: Jesse Gross; +Cc: David Miller, Linux Netdev List, Joe Stringer, Eric Dumazet
In-Reply-To: <1419264223-30004-1-git-send-email-jesse@nicira.com>

On Mon, Dec 22, 2014 at 8:03 AM, Jesse Gross <jesse@nicira.com> wrote:
> GSO isn't the only offload feature with restrictions that
> potentially can't be expressed with the current features mechanism.
> Checksum is another although it's a general issue that could in
> theory apply to anything. Even if it may be possible to
> implement these restrictions in other ways, it can result in
> duplicate code or inefficient per-packet behavior.
>
> This generalizes ndo_gso_check so that drivers can remove any
> features that don't make sense for a given packet, similar to
> netif_skb_features(). It also converts existing driver
> restrictions to the new format, completing the work that was
> done to support tunnel protocols since the issues apply to
> checksums as well.
>
It's a nice feature, but I really hope that this is not used for
checksums. We already have a sufficiently general interface for that
and checksum is already computed in drivers to work around HW bugs.

Acked-by:  Tom Herbert <therbert@google.com>

> CC: Tom Herbert <therbert@google.com>
> CC: Joe Stringer <joestringer@nicira.com>
> CC: Eric Dumazet <edumazet@google.com>
> Signed-off-by: Jesse Gross <jesse@nicira.com>
> Fixes: 04ffcb255f22 ("net: Add ndo_gso_check")
> ---
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |  8 ++++---
>  drivers/net/ethernet/emulex/benet/be_main.c      |  8 ++++---
>  drivers/net/ethernet/mellanox/mlx4/en_netdev.c   | 10 +++++----
>  drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |  8 ++++---
>  include/linux/netdevice.h                        | 20 +++++++++--------
>  include/net/vxlan.h                              | 28 ++++++++++++++++++++----
>  net/core/dev.c                                   | 28 ++++++++++++++++--------
>  7 files changed, 75 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> index 9f5e387..72eef9f 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> @@ -12553,9 +12553,11 @@ static int bnx2x_get_phys_port_id(struct net_device *netdev,
>         return 0;
>  }
>
> -static bool bnx2x_gso_check(struct sk_buff *skb, struct net_device *dev)
> +static netdev_features_t bnx2x_features_check(struct sk_buff *skb,
> +                                             struct net_device *dev,
> +                                             netdev_features_t features)
>  {
> -       return vxlan_gso_check(skb);
> +       return vxlan_features_check(skb, features);
>  }
>
>  static const struct net_device_ops bnx2x_netdev_ops = {
> @@ -12589,7 +12591,7 @@ static const struct net_device_ops bnx2x_netdev_ops = {
>  #endif
>         .ndo_get_phys_port_id   = bnx2x_get_phys_port_id,
>         .ndo_set_vf_link_state  = bnx2x_set_vf_link_state,
> -       .ndo_gso_check          = bnx2x_gso_check,
> +       .ndo_features_check     = bnx2x_features_check,
>  };
>
>  static int bnx2x_set_coherency_mask(struct bnx2x *bp)
> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
> index 1960731..41a0a54 100644
> --- a/drivers/net/ethernet/emulex/benet/be_main.c
> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
> @@ -4459,9 +4459,11 @@ done:
>         adapter->vxlan_port_count--;
>  }
>
> -static bool be_gso_check(struct sk_buff *skb, struct net_device *dev)
> +static netdev_features_t be_features_check(struct sk_buff *skb,
> +                                          struct net_device *dev,
> +                                          netdev_features_t features)
>  {
> -       return vxlan_gso_check(skb);
> +       return vxlan_features_check(skb, features);
>  }
>  #endif
>
> @@ -4492,7 +4494,7 @@ static const struct net_device_ops be_netdev_ops = {
>  #ifdef CONFIG_BE2NET_VXLAN
>         .ndo_add_vxlan_port     = be_add_vxlan_port,
>         .ndo_del_vxlan_port     = be_del_vxlan_port,
> -       .ndo_gso_check          = be_gso_check,
> +       .ndo_features_check     = be_features_check,
>  #endif
>  };
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> index 190cbd9..d0d6dc1 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
> @@ -2365,9 +2365,11 @@ static void mlx4_en_del_vxlan_port(struct  net_device *dev,
>         queue_work(priv->mdev->workqueue, &priv->vxlan_del_task);
>  }
>
> -static bool mlx4_en_gso_check(struct sk_buff *skb, struct net_device *dev)
> +static netdev_features_t mlx4_en_features_check(struct sk_buff *skb,
> +                                               struct net_device *dev,
> +                                               netdev_features_t features)
>  {
> -       return vxlan_gso_check(skb);
> +       return vxlan_features_check(skb, features);
>  }
>  #endif
>
> @@ -2400,7 +2402,7 @@ static const struct net_device_ops mlx4_netdev_ops = {
>  #ifdef CONFIG_MLX4_EN_VXLAN
>         .ndo_add_vxlan_port     = mlx4_en_add_vxlan_port,
>         .ndo_del_vxlan_port     = mlx4_en_del_vxlan_port,
> -       .ndo_gso_check          = mlx4_en_gso_check,
> +       .ndo_features_check     = mlx4_en_features_check,
>  #endif
>  };
>
> @@ -2434,7 +2436,7 @@ static const struct net_device_ops mlx4_netdev_ops_master = {
>  #ifdef CONFIG_MLX4_EN_VXLAN
>         .ndo_add_vxlan_port     = mlx4_en_add_vxlan_port,
>         .ndo_del_vxlan_port     = mlx4_en_del_vxlan_port,
> -       .ndo_gso_check          = mlx4_en_gso_check,
> +       .ndo_features_check     = mlx4_en_features_check,
>  #endif
>  };
>
> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> index 1aa25b1..9929b97 100644
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> @@ -505,9 +505,11 @@ static void qlcnic_del_vxlan_port(struct net_device *netdev,
>         adapter->flags |= QLCNIC_DEL_VXLAN_PORT;
>  }
>
> -static bool qlcnic_gso_check(struct sk_buff *skb, struct net_device *dev)
> +static netdev_features_t qlcnic_features_check(struct sk_buff *skb,
> +                                              struct net_device *dev,
> +                                              netdev_features_t features)
>  {
> -       return vxlan_gso_check(skb);
> +       return vxlan_features_check(skb, features);
>  }
>  #endif
>
> @@ -532,7 +534,7 @@ static const struct net_device_ops qlcnic_netdev_ops = {
>  #ifdef CONFIG_QLCNIC_VXLAN
>         .ndo_add_vxlan_port     = qlcnic_add_vxlan_port,
>         .ndo_del_vxlan_port     = qlcnic_del_vxlan_port,
> -       .ndo_gso_check          = qlcnic_gso_check,
> +       .ndo_features_check     = qlcnic_features_check,
>  #endif
>  #ifdef CONFIG_NET_POLL_CONTROLLER
>         .ndo_poll_controller = qlcnic_poll_controller,
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index c31f74d..679e6e9 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -1012,12 +1012,15 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
>   *     Callback to use for xmit over the accelerated station. This
>   *     is used in place of ndo_start_xmit on accelerated net
>   *     devices.
> - * bool        (*ndo_gso_check) (struct sk_buff *skb,
> - *                       struct net_device *dev);
> + * netdev_features_t (*ndo_features_check) (struct sk_buff *skb,
> + *                                         struct net_device *dev
> + *                                         netdev_features_t features);
>   *     Called by core transmit path to determine if device is capable of
> - *     performing GSO on a packet. The device returns true if it is
> - *     able to GSO the packet, false otherwise. If the return value is
> - *     false the stack will do software GSO.
> + *     performing offload operations on a given packet. This is to give
> + *     the device an opportunity to implement any restrictions that cannot
> + *     be otherwise expressed by feature flags. The check is called with
> + *     the set of features that the stack has calculated and it returns
> + *     those the driver believes to be appropriate.
>   *
>   * int (*ndo_switch_parent_id_get)(struct net_device *dev,
>   *                                struct netdev_phys_item_id *psid);
> @@ -1178,8 +1181,9 @@ struct net_device_ops {
>                                                         struct net_device *dev,
>                                                         void *priv);
>         int                     (*ndo_get_lock_subclass)(struct net_device *dev);
> -       bool                    (*ndo_gso_check) (struct sk_buff *skb,
> -                                                 struct net_device *dev);
> +       netdev_features_t       (*ndo_features_check) (struct sk_buff *skb,
> +                                                      struct net_device *dev,
> +                                                      netdev_features_t features);
>  #ifdef CONFIG_NET_SWITCHDEV
>         int                     (*ndo_switch_parent_id_get)(struct net_device *dev,
>                                                             struct netdev_phys_item_id *psid);
> @@ -3611,8 +3615,6 @@ static inline bool netif_needs_gso(struct net_device *dev, struct sk_buff *skb,
>                                    netdev_features_t features)
>  {
>         return skb_is_gso(skb) && (!skb_gso_ok(skb, features) ||
> -               (dev->netdev_ops->ndo_gso_check &&
> -                !dev->netdev_ops->ndo_gso_check(skb, dev)) ||
>                 unlikely((skb->ip_summed != CHECKSUM_PARTIAL) &&
>                          (skb->ip_summed != CHECKSUM_UNNECESSARY)));
>  }
> diff --git a/include/net/vxlan.h b/include/net/vxlan.h
> index 57cccd0..903461a 100644
> --- a/include/net/vxlan.h
> +++ b/include/net/vxlan.h
> @@ -1,6 +1,9 @@
>  #ifndef __NET_VXLAN_H
>  #define __NET_VXLAN_H 1
>
> +#include <linux/ip.h>
> +#include <linux/ipv6.h>
> +#include <linux/if_vlan.h>
>  #include <linux/skbuff.h>
>  #include <linux/netdevice.h>
>  #include <linux/udp.h>
> @@ -51,16 +54,33 @@ int vxlan_xmit_skb(struct vxlan_sock *vs,
>                    __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df,
>                    __be16 src_port, __be16 dst_port, __be32 vni, bool xnet);
>
> -static inline bool vxlan_gso_check(struct sk_buff *skb)
> +static inline netdev_features_t vxlan_features_check(struct sk_buff *skb,
> +                                                    netdev_features_t features)
>  {
> -       if ((skb_shinfo(skb)->gso_type & SKB_GSO_UDP_TUNNEL) &&
> +       u8 l4_hdr = 0;
> +
> +       if (!skb->encapsulation)
> +               return features;
> +
> +       switch (vlan_get_protocol(skb)) {
> +       case htons(ETH_P_IP):
> +               l4_hdr = ip_hdr(skb)->protocol;
> +               break;
> +       case htons(ETH_P_IPV6):
> +               l4_hdr = ipv6_hdr(skb)->nexthdr;
> +               break;
> +       default:
> +               return features;;
> +       }
> +
> +       if ((l4_hdr == IPPROTO_UDP) &&
>             (skb->inner_protocol_type != ENCAP_TYPE_ETHER ||
>              skb->inner_protocol != htons(ETH_P_TEB) ||
>              (skb_inner_mac_header(skb) - skb_transport_header(skb) !=
>               sizeof(struct udphdr) + sizeof(struct vxlanhdr))))
> -               return false;
> +               return features & ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK);
>
> -       return true;
> +       return features;
>  }
>
>  /* IP header + UDP + VXLAN + Ethernet header */
> diff --git a/net/core/dev.c b/net/core/dev.c
> index f411c28..fc13f72 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2562,7 +2562,7 @@ static netdev_features_t harmonize_features(struct sk_buff *skb,
>
>  netdev_features_t netif_skb_features(struct sk_buff *skb)
>  {
> -       const struct net_device *dev = skb->dev;
> +       struct net_device *dev = skb->dev;
>         netdev_features_t features = dev->features;
>         u16 gso_segs = skb_shinfo(skb)->gso_segs;
>         __be16 protocol = skb->protocol;
> @@ -2570,11 +2570,19 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
>         if (gso_segs > dev->gso_max_segs || gso_segs < dev->gso_min_segs)
>                 features &= ~NETIF_F_GSO_MASK;
>
> +       /* If encapsulation offload request, verify we are testing
> +        * hardware encapsulation features instead of standard
> +        * features for the netdev
> +        */
> +       if (skb->encapsulation)
> +               features = netdev_intersect_features(features,
> +                                                    dev->hw_enc_features);
> +
>         if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD)) {
>                 struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
>                 protocol = veh->h_vlan_encapsulated_proto;
>         } else if (!vlan_tx_tag_present(skb)) {
> -               return harmonize_features(skb, features);
> +               goto finalize;
>         }
>
>         features = netdev_intersect_features(features,
> @@ -2591,6 +2599,15 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)
>                                                      NETIF_F_HW_VLAN_CTAG_TX |
>                                                      NETIF_F_HW_VLAN_STAG_TX);
>
> +finalize:
> +       if (dev->netdev_ops->ndo_features_check) {
> +               netdev_features_t dev_features;
> +
> +               dev_features = dev->netdev_ops->ndo_features_check(skb, dev,
> +                                                                  features);
> +               features = netdev_intersect_features(features, dev_features);
> +       }
> +
>         return harmonize_features(skb, features);
>  }
>  EXPORT_SYMBOL(netif_skb_features);
> @@ -2661,13 +2678,6 @@ static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device
>         if (unlikely(!skb))
>                 goto out_null;
>
> -       /* If encapsulation offload request, verify we are testing
> -        * hardware encapsulation features instead of standard
> -        * features for the netdev
> -        */
> -       if (skb->encapsulation)
> -               features &= dev->hw_enc_features;
> -
>         if (netif_needs_gso(dev, skb, features)) {
>                 struct sk_buff *segs;
>
> --
> 1.9.1
>

^ permalink raw reply

* Re: [PATCH iproute2 v2] tc: Show classes in tree view
From: Stephen Hemminger @ 2014-12-23  1:35 UTC (permalink / raw)
  To: Vadim Kochan; +Cc: netdev
In-Reply-To: <1419263518-14434-1-git-send-email-vadim4j@gmail.com>

On Mon, 22 Dec 2014 17:51:58 +0200
Vadim Kochan <vadim4j@gmail.com> wrote:

> +	while (cls && cls->cls_parent) {
> +		cls->cls_parent->cls_right = cls;
> +		cls = cls->cls_parent;
> +	}
> +	while (cls && cls->cls_right)
> +	{

Why the sudden shift of bracketing style?

^ permalink raw reply

* Re: [PATCH] bonding: change error message to debug message in __bond_release_one()
From: Ding Tianhong @ 2014-12-23  1:48 UTC (permalink / raw)
  To: Wengang Wang, netdev, gospo
In-Reply-To: <1419297876-1412-1-git-send-email-wen.gang.wang@oracle.com>

On 2014/12/23 9:24, Wengang Wang wrote:
> In __bond_release_one(), when the interface is not a slave or not a slave of
> "this" master, it log error message.
> 
> The message actually should be a debug message matching what bond_enslave()
> does.
> 
> Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
> ---
>  drivers/net/bonding/bond_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 184c434..0dceba1 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1648,7 +1648,7 @@ static int __bond_release_one(struct net_device *bond_dev,
>  	/* slave is not a slave or master is not master of this slave */
>  	if (!(slave_dev->flags & IFF_SLAVE) ||
>  	    !netdev_has_upper_dev(slave_dev, bond_dev)) {
> -		netdev_err(bond_dev, "cannot release %s\n",
> +		netdev_dbg(bond_dev, "cannot release %s\n",
>  			   slave_dev->name);
>  		return -EINVAL;
>  	}
> 
Acked-by: Ding Tianhong <dingtianhong@huawei.com>

^ permalink raw reply

* [PATCH v3] 3c59x: Fix memory leaks in vortex_open
From: Jia-Ju Bai @ 2014-12-23  2:54 UTC (permalink / raw)
  To: davem, nhorman, ebiederm, dingtianhong, paul.gortmaker,
	justinvanwijngaarden
  Cc: netdev, Jia-Ju Bai

For linux-3.18.0
The driver calls __netdev_alloc_skb in vortex_open but lacks dev_kfree_skb
when vortex_up is failed, so memory leaks may occur in this situation.
This patch fixes this problem.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
---
 drivers/net/ethernet/3com/3c59x.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index 41095eb..d0c5bee 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -1782,6 +1782,16 @@ vortex_open(struct net_device *dev)
 	if (!retval)
 		goto out;
 
+	if (vp->full_bus_master_rx) {
+		for (i = 0; i < RX_RING_SIZE; i++) {
+			if (vp->rx_skbuff[i]) {
+				dev_kfree_skb(vp->rx_skbuff[i]);
+				vp->rx_skbuff[i] = NULL;
+			}
+		}
+		retval = -ENOMEM;
+	}
+
 err_free_irq:
 	free_irq(dev->irq, dev);
 err:
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH v3] ne2k-pci: Add pci_disable_device in error handling
From: Jia-Ju Bai @ 2014-12-23  3:29 UTC (permalink / raw)
  To: davem, bhelgaas, benoit.taine; +Cc: netdev, Jia-Ju Bai

For linux-3.18.0
The driver lacks pci_disable_device in error handling code of
ne2k_pci_init_one, so the device enabled by pci_enable_device is not
disabled when errors occur.
This patch fixes this problem.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
---
 drivers/net/ethernet/8390/ne2k-pci.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/8390/ne2k-pci.c b/drivers/net/ethernet/8390/ne2k-pci.c
index 89c8d9f..160c161 100644
--- a/drivers/net/ethernet/8390/ne2k-pci.c
+++ b/drivers/net/ethernet/8390/ne2k-pci.c
@@ -246,13 +246,13 @@ static int ne2k_pci_init_one(struct pci_dev *pdev,
 
 	if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_IO) == 0)) {
 		dev_err(&pdev->dev, "no I/O resource at PCI BAR #0\n");
-		return -ENODEV;
+		goto err_out;
 	}
 
 	if (request_region (ioaddr, NE_IO_EXTENT, DRV_NAME) == NULL) {
 		dev_err(&pdev->dev, "I/O resource 0x%x @ 0x%lx busy\n",
 			NE_IO_EXTENT, ioaddr);
-		return -EBUSY;
+		goto err_out;
 	}
 
 	reg0 = inb(ioaddr);
@@ -392,6 +392,8 @@ err_out_free_netdev:
 	free_netdev (dev);
 err_out_free_res:
 	release_region (ioaddr, NE_IO_EXTENT);
+err_out:
+	pci_disable_device(pdev);
 	return -ENODEV;
 }
 
-- 
1.7.9.5

^ permalink raw reply related

* RE: [PATCH net] net: Generalize ndo_gso_check to ndo_features_check
From: Sathya Perla @ 2014-12-23  6:24 UTC (permalink / raw)
  To: Tom Herbert, Jesse Gross
  Cc: David Miller, Linux Netdev List, Joe Stringer, Eric Dumazet
In-Reply-To: <CA+mtBx9vYV5i9_u=XMmEgSV3Uj9SEJAZHrKhTgyGgBG9Ojs-dA@mail.gmail.com>

> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-
> owner@vger.kernel.org] On Behalf Of Tom Herbert
> 
> On Mon, Dec 22, 2014 at 8:03 AM, Jesse Gross <jesse@nicira.com> wrote:
> > GSO isn't the only offload feature with restrictions that
> > potentially can't be expressed with the current features mechanism.
> > Checksum is another although it's a general issue that could in
> > theory apply to anything. Even if it may be possible to
> > implement these restrictions in other ways, it can result in
> > duplicate code or inefficient per-packet behavior.
> >
> > This generalizes ndo_gso_check so that drivers can remove any
> > features that don't make sense for a given packet, similar to
> > netif_skb_features(). It also converts existing driver
> > restrictions to the new format, completing the work that was
> > done to support tunnel protocols since the issues apply to
> > checksums as well.
> >
> It's a nice feature, but I really hope that this is not used for
> checksums. We already have a sufficiently general interface for that
> and checksum is already computed in drivers to work around HW bugs.
> 
The ndo_featureas_check() interface that includes a means to report
inability to compute inner checksums on some tunnel types, seems like
a useful feature. The Skyhawk-R NIC can support inner csum offload for
either vxlan or nv-gre, but not both simultaneously. So, this ndo_
is useful in reporting this situation.
This would also obviate the need to have extra code in the drivers to
compute csums in the above scenario.

thanks,
-Sathya

^ permalink raw reply

* Re: [PATCH for 3.19] rtlwifi: Fix error when accessing unmapped memory in skb
From: Kalle Valo @ 2014-12-23  6:37 UTC (permalink / raw)
  To: Larry Finger; +Cc: Eric Biggers, linux-wireless, netdev, Stable
In-Reply-To: <54989E12.6050808@lwfinger.net>

Larry Finger <Larry.Finger@lwfinger.net> writes:

> You are correct. In trying to get a small patch for stable, I missed
> some important points.
>
> Please look at the attached patch. I think it handles the skb
> allocations correctly. The critical point is that
> _rtl_pci_init_one_rxdesc() cannot be allowed to fail to allocate an
> skb while in the interrupt path. Now, I have already allocated the skb
> before the call and bypassed this routine if the allocation fails.
> After a couple of crashes, this one now works for the case when the
> allocation wouldn't fail anyway. I will likely pull the allocation out
> of _rtl_pci_init_one_rxdesc() in all cases for the final patch.
>
> @Kalle: Please drop the patch I submitted this morning with this
> subject. It would not help the problem. I will resubmit after I am
> sure of the proper fix.

Ack. I'll wait for v2.

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH RFC] ipw2200: select CFG80211_WEXT
From: Kalle Valo @ 2014-12-23  6:52 UTC (permalink / raw)
  To: Paul Bolle
  Cc: Johannes Berg, Stanislav Yakovlev, linux-wireless, netdev,
	linux-kernel
In-Reply-To: <1419271817.2317.12.camel@tiscali.nl>

Paul Bolle <pebolle@tiscali.nl> writes:

> Commit 24a0aa212ee2 ("cfg80211: make WEXT compatibility unselectable")
> made it impossible to depend on CFG80211_WEXT. It does still allow to
> select that symbol. (Yes, the commit summary is confusing.)
>
> So make IPW2200 select CFG80211_WEXT, so that the ipw2200 driver can be
> built again.

I think the last sentence is a bit misleading (this isn't a compilation
error, right?) and I would like to clarify it like this:

"So make IPW2200 select CFG80211_WEXT, so that the ipw2200 driver can be
enabled in config again."

Does that look ok?

-- 
Kalle Valo

^ permalink raw reply

* [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling
From: Jia-Ju Bai @ 2014-12-23  7:17 UTC (permalink / raw)
  To: davem, sergei.shtylyov, jeffrey.t.kirsher, bruce.w.allan,
	jesse.brandeburg
  Cc: e1000-devel, netdev, Jia-Ju Bai, linux.nics

For linux-3.18.0
The driver lacks igb_disable_sriov in error handling,
which should match igb_enable_sriov in igb_probe.
This patch fixes this problem, and it has been tested in runtime.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 487cd9c..91914e4 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -179,6 +179,7 @@ static void igb_check_vf_rate_limit(struct igb_adapter *);
 #ifdef CONFIG_PCI_IOV
 static int igb_vf_configure(struct igb_adapter *adapter, int vf);
 static int igb_pci_enable_sriov(struct pci_dev *dev, int num_vfs);
+static int igb_disable_sriov(struct pci_dev *pdev);
 #endif
 
 #ifdef CONFIG_PM
@@ -2653,6 +2654,9 @@ err_register:
 	igb_release_hw_control(adapter);
 	memset(&adapter->i2c_adap, 0, sizeof(adapter->i2c_adap));
 err_eeprom:
+#ifdef CONFIG_PCI_IOV
+	igb_disable_sriov(pdev);
+#endif
 	if (!igb_check_reset_block(hw))
 		igb_reset_phy(hw);
 
-- 
1.7.9.5



------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply related

* [PATCH v3 2/3] igb: Add pci_disable_pcie_error_reporting in error handling
From: Jia-Ju Bai @ 2014-12-23  7:17 UTC (permalink / raw)
  To: davem, sergei.shtylyov, jeffrey.t.kirsher, bruce.w.allan,
	jesse.brandeburg
  Cc: e1000-devel, netdev, Jia-Ju Bai, linux.nics
In-Reply-To: <1419319024-30455-1-git-send-email-baijiaju1990@163.com>

For linux-3.18.0
The driver lacks pci_disable_pcie_error_reporting in error handling,
which should match pci_enable_pcie_error_reporting in igb_probe.
This patch fixes this problem, and it has been tested in runtime.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 487cd9c..59e0ba4 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2664,6 +2664,7 @@ err_sw_init:
 err_ioremap:
 	free_netdev(netdev);
 err_alloc_etherdev:
+	pci_disable_pcie_error_reporting(pdev);
 	pci_release_selected_regions(pdev,
 				     pci_select_bars(pdev, IORESOURCE_MEM));
 err_pci_reg:
-- 
1.7.9.5



------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply related

* [PATCH v3 3/3] igb: Fix a memory leak in igb_probe
From: Jia-Ju Bai @ 2014-12-23  7:17 UTC (permalink / raw)
  To: davem, sergei.shtylyov, jeffrey.t.kirsher, bruce.w.allan,
	jesse.brandeburg
  Cc: e1000-devel, netdev, Jia-Ju Bai, linux.nics
In-Reply-To: <1419319024-30455-1-git-send-email-baijiaju1990@163.com>

For linux-3.18.0
The driver calls kcalloc to allocate memory for adapter->shadow_vfta
in igb_sw_init, but kfree is not called in error handling of igb_probe.
So when register_netdev or igb_init_i2c is failed, a memory leak occurs.
This patch fixes this problem, and it has been tested in runtime.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 487cd9c..a0be1e5 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2659,6 +2659,7 @@ err_eeprom:
 	if (hw->flash_address)
 		iounmap(hw->flash_address);
 err_sw_init:
+	kfree(adapter->shadow_vfta);
 	igb_clear_interrupt_scheme(adapter);
 	pci_iounmap(pdev, hw->hw_addr);
 err_ioremap:
-- 
1.7.9.5



------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply related

* Re: [PATCH iproute2 v2] tc: Show classes in tree view
From: Vadim Kochan @ 2014-12-23  7:10 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Vadim Kochan, netdev
In-Reply-To: <20141222173554.349bb18c@urahara>

On Mon, Dec 22, 2014 at 05:35:54PM -0800, Stephen Hemminger wrote:
> On Mon, 22 Dec 2014 17:51:58 +0200
> Vadim Kochan <vadim4j@gmail.com> wrote:
> 
> > +	while (cls && cls->cls_parent) {
> > +		cls->cls_parent->cls_right = cls;
> > +		cls = cls->cls_parent;
> > +	}
> > +	while (cls && cls->cls_right)
> > +	{
> 
> Why the sudden shift of bracketing style?
Oh no, it happened, in company where I work they uses different style, sorry ...

Thanks,

^ permalink raw reply

* Re: [PATCH v3 3/3] igb: Fix a memory leak in igb_probe
From: Varka Bhadram @ 2014-12-23  7:29 UTC (permalink / raw)
  To: Jia-Ju Bai
  Cc: davem@davemloft.net, Sergei Shtylyov, Kirsher, Jeffrey T,
	Allan, Bruce W, Brandeburg, Jesse, <linux.nics@intel.com>,
	e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org
In-Reply-To: <1419319024-30455-3-git-send-email-baijiaju1990@163.com>

On Tue, Dec 23, 2014 at 12:47 PM, Jia-Ju Bai <baijiaju1990@163.com> wrote:
> For linux-3.18.0
> The driver calls kcalloc to allocate memory for adapter->shadow_vfta
> in igb_sw_init, but kfree is not called in error handling of igb_probe.
> So when register_netdev or igb_init_i2c is failed, a memory leak occurs.
> This patch fixes this problem, and it has been tested in runtime.
>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
> ---
>  drivers/net/ethernet/intel/igb/igb_main.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index 487cd9c..a0be1e5 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -2659,6 +2659,7 @@ err_eeprom:
>         if (hw->flash_address)
>                 iounmap(hw->flash_address);
>  err_sw_init:
> +       kfree(adapter->shadow_vfta);
Why dont you use devm_kcalloc()..? So no need to worry about freeing it.
>         igb_clear_interrupt_scheme(adapter);
>         pci_iounmap(pdev, hw->hw_addr);
>  err_ioremap:
> --
> 1.7.9.5
>
>
> --
> 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



-- 
Thanks and Regards,
Varka Bhadram.

^ permalink raw reply

* Re: caif: Fix napi poll list corruption
From: Jason Wang @ 2014-12-22 10:02 UTC (permalink / raw)
  To: Herbert Xu
  Cc: David Vrabel, netdev, xen-devel, konrad.wilk, boris.ostrovsky,
	edumazet, David S. Miller
In-Reply-To: <20141222093525.GA18616@gondor.apana.org.au>



On Mon, Dec 22, 2014 at 5:35 PM, Herbert Xu 
<herbert@gondor.apana.org.au> wrote:
> On Mon, Dec 22, 2014 at 04:18:33PM +0800, Jason Wang wrote:
>> 
>>  btw, looks like at least caif_virtio has the same issue.
> 
> Good catch.
> 
> -- >8 --
> The commit d75b1ade567ffab085e8adbbdacf0092d10cd09c (net: less
> interrupt masking in NAPI) breaks caif.
> 
> It is now required that if the entire budget is consumed when poll
> returns, the napi poll_list must remain empty.  However, like some
> other drivers caif tries to do a last-ditch check and if there is
> more work it will call napi_schedule and then immediately process
> some of this new work.  Should the entire budget be consumed while
> processing such new work then we will violate the new caller
> contract.
> 
> This patch fixes this by not touching any work when we reschedule
> in caif.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks.
> 
> 
> diff --git a/drivers/net/caif/caif_virtio.c 
> b/drivers/net/caif/caif_virtio.c
> index a5fefb9..b306210 100644
> --- a/drivers/net/caif/caif_virtio.c
> +++ b/drivers/net/caif/caif_virtio.c
> @@ -257,7 +257,6 @@ static int cfv_rx_poll(struct napi_struct *napi, 
> int quota)
>  	struct vringh_kiov *riov = &cfv->ctx.riov;
>  	unsigned int skb_len;
>  
> -again:
>  	do {
>  		skb = NULL;
>  
> @@ -322,7 +321,6 @@ exit:
>  		    napi_schedule_prep(napi)) {
>  			vringh_notify_disable_kern(cfv->vr_rx);
>  			__napi_schedule(napi);
> -			goto again;
>  		}
>  		break;
> 
> Thanks,
> -- 
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
> 

^ permalink raw reply

* Re: [PATCH RFC] ipw2200: select CFG80211_WEXT
From: Paul Bolle @ 2014-12-23 10:20 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Johannes Berg, Stanislav Yakovlev, linux-wireless, netdev,
	linux-kernel
In-Reply-To: <871tnqhn7j.fsf@kamboji.qca.qualcomm.com>

On Tue, 2014-12-23 at 08:52 +0200, Kalle Valo wrote:
> Paul Bolle <pebolle@tiscali.nl> writes:
> 
> > Commit 24a0aa212ee2 ("cfg80211: make WEXT compatibility unselectable")
> > made it impossible to depend on CFG80211_WEXT. It does still allow to
> > select that symbol. (Yes, the commit summary is confusing.)
> >
> > So make IPW2200 select CFG80211_WEXT, so that the ipw2200 driver can be
> > built again.
> 
> I think the last sentence is a bit misleading (this isn't a compilation
> error, right?)

No, it's not a compilation error.

The reasoning here is that all code hidden behind a Kconfig symbol that
cannot be set will, in practice, never be built. Sure, there are hoops
one can jump through to try to bypass the generated .config, but no one
should have to do that.

>  and I would like to clarify it like this:
> 
> "So make IPW2200 select CFG80211_WEXT, so that the ipw2200 driver can be
> enabled in config again."
> 
> Does that look ok?

I understand the confusion my text might cause, so I'm fine with your
amendment.

Thanks,


Paul Bolle

^ permalink raw reply

* Re: [PATCH RFC] ipw2200: select CFG80211_WEXT
From: Johannes Berg @ 2014-12-23 10:28 UTC (permalink / raw)
  To: Paul Bolle
  Cc: Stanislav Yakovlev, Kalle Valo, linux-wireless, netdev,
	linux-kernel
In-Reply-To: <1419271817.2317.12.camel@tiscali.nl>

On Mon, 2014-12-22 at 19:10 +0100, Paul Bolle wrote:
> Commit 24a0aa212ee2 ("cfg80211: make WEXT compatibility unselectable")
> made it impossible to depend on CFG80211_WEXT. It does still allow to
> select that symbol. (Yes, the commit summary is confusing.)
> 
> So make IPW2200 select CFG80211_WEXT, so that the ipw2200 driver can be
> built again.
> 
> Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
> ---
> Johannes,
> 
> Building v3.19-rc1 for an outdated ThinkPad X41 left me without the
> ipw2200 driver. It turns out this trivial patch is all that's needed to
> make ipw2200 buildable again.
> 
> (A similar patch would be needed for the drivers behind Kconfig symbol
> HERMES. Ie, orinico and friends.) 

Yeah, config HERMES needs the same change.

Kalle, do you want to take those through your tree, or should I fix it
seeing that I introduced the bug in a sense?

johannes

^ permalink raw reply

* Re: [PATCH net-next v2] packet: make packet_snd fail on len smaller than l2 header
From: Jouni Malinen @ 2014-12-23 10:37 UTC (permalink / raw)
  To: Willem de Bruijn; +Cc: netdev, davem, eric.dumazet, dborkman
In-Reply-To: <1416420616-5029-1-git-send-email-willemb@google.com>

On Wed, Nov 19, 2014 at 8:10 PM, Willem de Bruijn <willemb@google.com> wrote:
> When sending packets out with PF_PACKET, SOCK_RAW, ensure that the
> packet is at least as long as the device's expected link layer header.
> This check already exists in tpacket_snd, but not in packet_snd.

Was this supposed to be refusing zero-length payload following the
header like the implementation does or accept zero-length payload like
this commit message seems to imply? Based on the commit message, I'd
assume 14 byte buffer on Ethernet netdev should have been accepted.

I just noticed that once pulling this commit in into my automated test
setup, one of the test cases started failing because of the change
here. That test case was trying to transmit a minimum length Ethernet
header using raw packet socket. Not that I care too much since I can
easily change the test case to use one octet longer data to send and
this was not really a real protocol case, but I wanted to confirm what
was the expected behavior here since this commit seems to have number
of inconsistent statements between the commit message, actual
validation step, debug print, and code comment..

> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> @@ -2095,6 +2095,18 @@ static void tpacket_destruct_skb(struct sk_buff *skb)
> +static bool ll_header_truncated(const struct net_device *dev, int len)
> +{
> +       /* net device doesn't like empty head */

I'm not sure how to interpret "empty head". Is that saying that the
data following the header should not be empty? Or that header should
be at least hard_header_len?

> +       if (unlikely(len <= dev->hard_header_len)) {

That would be rejecting exactly hard_header_len, i.e,., I would have
expected < instead of <= here based on the commit message.

> +               net_warn_ratelimited("%s: packet size is too short (%d < %d)\n",
> +                                    current->comm, len, dev->hard_header_len);

But that debug print uses < instead of <= which is not consistent with
the actual condition (and yes, I realize this was there even before
this commit).

- Jouni

^ permalink raw reply

* Re: [PATCH RFC] ipw2200: select CFG80211_WEXT
From: Kalle Valo @ 2014-12-23 10:50 UTC (permalink / raw)
  To: Paul Bolle
  Cc: Johannes Berg, Stanislav Yakovlev, linux-wireless, netdev,
	linux-kernel
In-Reply-To: <1419330055.30945.76.camel@x220>

Paul Bolle <pebolle@tiscali.nl> writes:

> On Tue, 2014-12-23 at 08:52 +0200, Kalle Valo wrote:
>> Paul Bolle <pebolle@tiscali.nl> writes:
>> 
>> > Commit 24a0aa212ee2 ("cfg80211: make WEXT compatibility unselectable")
>> > made it impossible to depend on CFG80211_WEXT. It does still allow to
>> > select that symbol. (Yes, the commit summary is confusing.)
>> >
>> > So make IPW2200 select CFG80211_WEXT, so that the ipw2200 driver can be
>> > built again.
>> 
>> I think the last sentence is a bit misleading (this isn't a compilation
>> error, right?)
>
> No, it's not a compilation error.
>
> The reasoning here is that all code hidden behind a Kconfig symbol that
> cannot be set will, in practice, never be built. Sure, there are hoops
> one can jump through to try to bypass the generated .config, but no one
> should have to do that.
>
>>  and I would like to clarify it like this:
>> 
>> "So make IPW2200 select CFG80211_WEXT, so that the ipw2200 driver can be
>> enabled in config again."
>> 
>> Does that look ok?
>
> I understand the confusion my text might cause, so I'm fine with your
> amendment.

Thanks for checking. I'll modify the commit log and apply it to
wireless-drivers.git.

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH RFC] ipw2200: select CFG80211_WEXT
From: Kalle Valo @ 2014-12-23 10:55 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Paul Bolle, Stanislav Yakovlev, linux-wireless, netdev,
	linux-kernel
In-Reply-To: <1419330521.6091.1.camel@sipsolutions.net>

Johannes Berg <johannes@sipsolutions.net> writes:

> On Mon, 2014-12-22 at 19:10 +0100, Paul Bolle wrote:
>> Commit 24a0aa212ee2 ("cfg80211: make WEXT compatibility unselectable")
>> made it impossible to depend on CFG80211_WEXT. It does still allow to
>> select that symbol. (Yes, the commit summary is confusing.)
>> 
>> So make IPW2200 select CFG80211_WEXT, so that the ipw2200 driver can be
>> built again.
>> 
>> Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
>> ---
>> Johannes,
>> 
>> Building v3.19-rc1 for an outdated ThinkPad X41 left me without the
>> ipw2200 driver. It turns out this trivial patch is all that's needed to
>> make ipw2200 buildable again.
>> 
>> (A similar patch would be needed for the drivers behind Kconfig symbol
>> HERMES. Ie, orinico and friends.) 
>
> Yeah, config HERMES needs the same change.
>
> Kalle, do you want to take those through your tree, or should I fix it
> seeing that I introduced the bug in a sense?

To keep things simple I would prefer to take this through
wireless-drivers.git, if it's ok for you.

-- 
Kalle Valo

^ permalink raw reply

* [PATCH 1/3] net/fsl: remove reset from xgmac_mdio
From: shh.xie @ 2014-12-23  9:45 UTC (permalink / raw)
  To: netdev, davem; +Cc: Shaohui Xie

From: Shaohui Xie <Shaohui.Xie@freescale.com>

Since the reset is just clock setting, individual mdio reset is
not available.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
 drivers/net/ethernet/freescale/xgmac_mdio.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c
index 6e7db66..90adba1 100644
--- a/drivers/net/ethernet/freescale/xgmac_mdio.c
+++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
@@ -174,24 +174,6 @@ static int xgmac_mdio_read(struct mii_bus *bus, int phy_id, int regnum)
 	return value;
 }
 
-/* Reset the MIIM registers, and wait for the bus to free */
-static int xgmac_mdio_reset(struct mii_bus *bus)
-{
-	struct tgec_mdio_controller __iomem *regs = bus->priv;
-	int ret;
-
-	mutex_lock(&bus->mdio_lock);
-
-	/* Setup the MII Mgmt clock speed */
-	out_be32(&regs->mdio_stat, MDIO_STAT_CLKDIV(100));
-
-	ret = xgmac_wait_until_free(&bus->dev, regs);
-
-	mutex_unlock(&bus->mdio_lock);
-
-	return ret;
-}
-
 static int xgmac_mdio_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
@@ -212,7 +194,6 @@ static int xgmac_mdio_probe(struct platform_device *pdev)
 	bus->name = "Freescale XGMAC MDIO Bus";
 	bus->read = xgmac_mdio_read;
 	bus->write = xgmac_mdio_write;
-	bus->reset = xgmac_mdio_reset;
 	bus->irq = bus->priv;
 	bus->parent = &pdev->dev;
 	snprintf(bus->id, MII_BUS_ID_SIZE, "%llx", (unsigned long long)res.start);
-- 
1.8.4.1

^ permalink raw reply related

* Re: [PATCH v3 1/3] igb: Add igb_disable_sriov in error handling
From: Sergei Shtylyov @ 2014-12-23 11:23 UTC (permalink / raw)
  To: Jia-Ju Bai, davem, jeffrey.t.kirsher, bruce.w.allan,
	jesse.brandeburg
  Cc: linux.nics, e1000-devel, netdev
In-Reply-To: <1419319024-30455-1-git-send-email-baijiaju1990@163.com>

Hello.

On 12/23/2014 10:17 AM, Jia-Ju Bai wrote:

> For linux-3.18.0

    For the future: such words should be placed under --- tear line...

> The driver lacks igb_disable_sriov in error handling,
> which should match igb_enable_sriov in igb_probe.
> This patch fixes this problem, and it has been tested in runtime.

> Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
> ---

    .... here.

>   drivers/net/ethernet/intel/igb/igb_main.c |    4 ++++
>   1 file changed, 4 insertions(+)

WBR, Sergei

^ permalink raw reply

* [PATCH 2/3] net/fsl: remove irq assignment from xgmac_mdio
From: shh.xie @ 2014-12-23  9:46 UTC (permalink / raw)
  To: netdev, davem; +Cc: Shaohui Xie

From: Shaohui Xie <Shaohui.Xie@freescale.com>

Which is wrong and not used, so no extra space needed by
mdio_alloc_size(), change the parameter accordingly.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
 drivers/net/ethernet/freescale/xgmac_mdio.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c
index 90adba1..72e0b85 100644
--- a/drivers/net/ethernet/freescale/xgmac_mdio.c
+++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
@@ -187,14 +187,13 @@ static int xgmac_mdio_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	bus = mdiobus_alloc_size(PHY_MAX_ADDR * sizeof(int));
+	bus = mdiobus_alloc_size(0);
 	if (!bus)
 		return -ENOMEM;
 
 	bus->name = "Freescale XGMAC MDIO Bus";
 	bus->read = xgmac_mdio_read;
 	bus->write = xgmac_mdio_write;
-	bus->irq = bus->priv;
 	bus->parent = &pdev->dev;
 	snprintf(bus->id, MII_BUS_ID_SIZE, "%llx", (unsigned long long)res.start);
 
-- 
1.8.4.1

^ permalink raw reply related

* [PATCH 3/3] net/fsl: remove hardcoded clock setting from xgmac_mdio
From: shh.xie @ 2014-12-23  9:47 UTC (permalink / raw)
  To: netdev, davem; +Cc: Shaohui Xie

From: Shaohui Xie <Shaohui.Xie@freescale.com>

There is no need to set the clock speed in read/write which will be performed
unnecessarily for each mdio access. Init it during probe is enough.

Also, the hardcoded clock value is not a proper way for all SoCs.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
 drivers/net/ethernet/freescale/xgmac_mdio.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c
index 72e0b85..f8c3bc0 100644
--- a/drivers/net/ethernet/freescale/xgmac_mdio.c
+++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
@@ -94,13 +94,6 @@ static int xgmac_mdio_write(struct mii_bus *bus, int phy_id, int regnum, u16 val
 	uint16_t dev_addr = regnum >> 16;
 	int ret;
 
-	/* Setup the MII Mgmt clock speed */
-	out_be32(&regs->mdio_stat, MDIO_STAT_CLKDIV(100));
-
-	ret = xgmac_wait_until_free(&bus->dev, regs);
-	if (ret)
-		return ret;
-
 	/* Set the port and dev addr */
 	out_be32(&regs->mdio_ctl,
 		 MDIO_CTL_PORT_ADDR(phy_id) | MDIO_CTL_DEV_ADDR(dev_addr));
@@ -135,13 +128,6 @@ static int xgmac_mdio_read(struct mii_bus *bus, int phy_id, int regnum)
 	uint16_t value;
 	int ret;
 
-	/* Setup the MII Mgmt clock speed */
-	out_be32(&regs->mdio_stat, MDIO_STAT_CLKDIV(100));
-
-	ret = xgmac_wait_until_free(&bus->dev, regs);
-	if (ret)
-		return ret;
-
 	/* Set the Port and Device Addrs */
 	mdio_ctl = MDIO_CTL_PORT_ADDR(phy_id) | MDIO_CTL_DEV_ADDR(dev_addr);
 	out_be32(&regs->mdio_ctl, mdio_ctl);
-- 
1.8.4.1

^ permalink raw reply related

* [PATCH] net: phy: micrel: use generic config_init for KSZ8021/KSZ8031
From: Johan Hovold @ 2014-12-23 11:59 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: netdev, linux-kernel, Bruno Thomsen, Johan Hovold

Use generic config_init callback also for KSZ8021 and KSZ8031.

This has been avoided this far due to commit b838b4aced99 ("phy/micrel:
KSZ8031RNL RMII clock reconfiguration bug"), which claims that the PHY
becomes unresponsive if the broadcast-disable flag is set before
configuring the clock mode.

Turns out that the problem seemingly worked-around by the above
mentioned commit was really due to a hardware-configuration issue, where
the PHY was in fact strapped to address 3 rather than 0.

Tested-by: Bruno Thomsen <bth@kamstrup.dk>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/phy/micrel.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index c530de1e63f5..3ad8ca76196d 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -88,6 +88,7 @@ struct kszphy_priv {
 
 static const struct kszphy_type ksz8021_type = {
 	.led_mode_reg		= MII_KSZPHY_CTRL_2,
+	.has_broadcast_disable	= true,
 	.has_rmii_ref_clk_sel	= true,
 };
 
@@ -258,19 +259,6 @@ static int kszphy_config_init(struct phy_device *phydev)
 	return 0;
 }
 
-static int ksz8021_config_init(struct phy_device *phydev)
-{
-	int rc;
-
-	rc = kszphy_config_init(phydev);
-	if (rc)
-		return rc;
-
-	rc = kszphy_broadcast_disable(phydev);
-
-	return rc < 0 ? rc : 0;
-}
-
 static int ksz9021_load_values_from_of(struct phy_device *phydev,
 				       struct device_node *of_node, u16 reg,
 				       char *field1, char *field2,
@@ -584,7 +572,7 @@ static struct phy_driver ksphy_driver[] = {
 	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
 	.driver_data	= &ksz8021_type,
 	.probe		= kszphy_probe,
-	.config_init	= ksz8021_config_init,
+	.config_init	= kszphy_config_init,
 	.config_aneg	= genphy_config_aneg,
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
@@ -601,7 +589,7 @@ static struct phy_driver ksphy_driver[] = {
 	.flags		= PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
 	.driver_data	= &ksz8021_type,
 	.probe		= kszphy_probe,
-	.config_init	= ksz8021_config_init,
+	.config_init	= kszphy_config_init,
 	.config_aneg	= genphy_config_aneg,
 	.read_status	= genphy_read_status,
 	.ack_interrupt	= kszphy_ack_interrupt,
-- 
2.0.5

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox