* Re: [PATCHv2 bluetooth-next 06/10] ndisc: add addr_len parameter to ndisc_fill_addr_option
From: Stefan Schmidt @ 2016-05-03 18:17 UTC (permalink / raw)
To: Alexander Aring, linux-wpan
Cc: kernel, marcel, jukka.rissanen, hannes, mcr, werner,
linux-bluetooth, netdev, David S . Miller, Alexey Kuznetsov,
James Morris, Hideaki YOSHIFUJI, Patrick McHardy
In-Reply-To: <1461140382-4784-7-git-send-email-aar@pengutronix.de>
Hello.
On 20/04/16 10:19, Alexander Aring wrote:
> This patch makes the address length as argument for the
> ndisc_fill_addr_option function. This is necessary to handle addresses
> which don't use dev->addr_len as address length.
>
> Cc: David S. Miller<davem@davemloft.net>
> Cc: Alexey Kuznetsov<kuznet@ms2.inr.ac.ru>
> Cc: James Morris<jmorris@namei.org>
> Cc: Hideaki YOSHIFUJI<yoshfuji@linux-ipv6.org>
> Cc: Patrick McHardy<kaber@trash.net>
> Signed-off-by: Alexander Aring<aar@pengutronix.de>
> ---
> net/ipv6/ndisc.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
> index 4e91d5e..176c7c4 100644
> --- a/net/ipv6/ndisc.c
> +++ b/net/ipv6/ndisc.c
> @@ -150,11 +150,11 @@ struct neigh_table nd_tbl = {
> };
> EXPORT_SYMBOL_GPL(nd_tbl);
>
> -static void ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data)
> +static void ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data,
> + int data_len)
> {
> int pad = ndisc_addr_option_pad(skb->dev->type);
> - int data_len = skb->dev->addr_len;
> - int space = ndisc_opt_addr_space(skb->dev, skb->dev->addr_len);
> + int space = ndisc_opt_addr_space(skb->dev, data_len);
> u8 *opt = skb_put(skb, space);
>
> opt[0] = type;
> @@ -528,7 +528,7 @@ void ndisc_send_na(struct net_device *dev, const struct in6_addr *daddr,
>
> if (inc_opt)
> ndisc_fill_addr_option(skb, ND_OPT_TARGET_LL_ADDR,
> - dev->dev_addr);
> + dev->dev_addr, dev->addr_len);
>
>
> ndisc_send_skb(skb, daddr, src_addr);
> @@ -590,7 +590,7 @@ void ndisc_send_ns(struct net_device *dev, const struct in6_addr *solicit,
>
> if (inc_opt)
> ndisc_fill_addr_option(skb, ND_OPT_SOURCE_LL_ADDR,
> - dev->dev_addr);
> + dev->dev_addr, dev->addr_len);
>
> ndisc_send_skb(skb, daddr, saddr);
> }
> @@ -641,7 +641,7 @@ void ndisc_send_rs(struct net_device *dev, const struct in6_addr *saddr,
>
> if (send_sllao)
> ndisc_fill_addr_option(skb, ND_OPT_SOURCE_LL_ADDR,
> - dev->dev_addr);
> + dev->dev_addr, dev->addr_len);
>
> ndisc_send_skb(skb, daddr, saddr);
> }
> @@ -1597,7 +1597,8 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
> */
>
> if (ha)
> - ndisc_fill_addr_option(buff, ND_OPT_TARGET_LL_ADDR, ha);
> + ndisc_fill_addr_option(buff, ND_OPT_TARGET_LL_ADDR, ha,
> + dev->addr_len);
>
> /*
> * build redirect option and copy skb over to the new packet.
Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>
regards
Stefan Schmidt
^ permalink raw reply
* Re: [PATCHv2 bluetooth-next 05/10] ndisc: add addr_len parameter to ndisc_opt_addr_data
From: Stefan Schmidt @ 2016-05-03 18:17 UTC (permalink / raw)
To: Alexander Aring, linux-wpan
Cc: kernel, marcel, jukka.rissanen, hannes, mcr, werner,
linux-bluetooth, netdev, David S . Miller, Alexey Kuznetsov,
James Morris, Hideaki YOSHIFUJI, Patrick McHardy
In-Reply-To: <1461140382-4784-6-git-send-email-aar@pengutronix.de>
Hello.
On 20/04/16 10:19, Alexander Aring wrote:
> This patch makes the address length as argument for the
> ndisc_opt_addr_data function. This is necessary to handle addresses
> which don't use dev->addr_len as address length.
>
> Cc: David S. Miller<davem@davemloft.net>
> Cc: Alexey Kuznetsov<kuznet@ms2.inr.ac.ru>
> Cc: James Morris<jmorris@namei.org>
> Cc: Hideaki YOSHIFUJI<yoshfuji@linux-ipv6.org>
> Cc: Patrick McHardy<kaber@trash.net>
> Signed-off-by: Alexander Aring<aar@pengutronix.de>
> ---
> include/net/ndisc.h | 5 +++--
> net/ipv6/ndisc.c | 11 +++++++----
> net/ipv6/route.c | 2 +-
> 3 files changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/include/net/ndisc.h b/include/net/ndisc.h
> index ef43e88..aac868e 100644
> --- a/include/net/ndisc.h
> +++ b/include/net/ndisc.h
> @@ -134,12 +134,13 @@ static inline int ndisc_opt_addr_space(struct net_device *dev,
> }
>
> static inline u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p,
> - struct net_device *dev)
> + struct net_device *dev,
> + unsigned char addr_len)
> {
> u8 *lladdr = (u8 *)(p + 1);
> int lladdrlen = p->nd_opt_len << 3;
> int prepad = ndisc_addr_option_pad(dev->type);
> - if (lladdrlen != ndisc_opt_addr_space(dev, dev->addr_len))
> + if (lladdrlen != ndisc_opt_addr_space(dev, addr_len))
> return NULL;
> return lladdr + prepad;
> }
> diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
> index 69e20e3..4e91d5e 100644
> --- a/net/ipv6/ndisc.c
> +++ b/net/ipv6/ndisc.c
> @@ -744,7 +744,8 @@ static void ndisc_recv_ns(struct sk_buff *skb)
> }
>
> if (ndopts.nd_opts_src_lladdr) {
> - lladdr = ndisc_opt_addr_data(ndopts.nd_opts_src_lladdr, dev);
> + lladdr = ndisc_opt_addr_data(ndopts.nd_opts_src_lladdr, dev,
> + dev->addr_len);
> if (!lladdr) {
> ND_PRINTK(2, warn,
> "NS: invalid link-layer address length\n");
> @@ -916,7 +917,8 @@ static void ndisc_recv_na(struct sk_buff *skb)
> return;
> }
> if (ndopts.nd_opts_tgt_lladdr) {
> - lladdr = ndisc_opt_addr_data(ndopts.nd_opts_tgt_lladdr, dev);
> + lladdr = ndisc_opt_addr_data(ndopts.nd_opts_tgt_lladdr, dev,
> + dev->addr_len);
> if (!lladdr) {
> ND_PRINTK(2, warn,
> "NA: invalid link-layer address length\n");
> @@ -1024,7 +1026,7 @@ static void ndisc_recv_rs(struct sk_buff *skb)
>
> if (ndopts.nd_opts_src_lladdr) {
> lladdr = ndisc_opt_addr_data(ndopts.nd_opts_src_lladdr,
> - skb->dev);
> + skb->dev, skb->dev->addr_len);
> if (!lladdr)
> goto out;
> }
> @@ -1322,7 +1324,8 @@ skip_linkparms:
> u8 *lladdr = NULL;
> if (ndopts.nd_opts_src_lladdr) {
> lladdr = ndisc_opt_addr_data(ndopts.nd_opts_src_lladdr,
> - skb->dev);
> + skb->dev,
> + skb->dev->addr_len);
> if (!lladdr) {
> ND_PRINTK(2, warn,
> "RA: invalid link-layer address length\n");
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index ed44663..cc180b3 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -2157,7 +2157,7 @@ static void rt6_do_redirect(struct dst_entry *dst, struct sock *sk, struct sk_bu
> lladdr = NULL;
> if (ndopts.nd_opts_tgt_lladdr) {
> lladdr = ndisc_opt_addr_data(ndopts.nd_opts_tgt_lladdr,
> - skb->dev);
> + skb->dev, skb->dev->addr_len);
> if (!lladdr) {
> net_dbg_ratelimited("rt6_redirect: invalid link-layer address length\n");
> return;
Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>
regards
Stefan Schmidt
^ permalink raw reply
* Re: [PATCHv2 bluetooth-next 04/10] ndisc: add addr_len parameter to ndisc_opt_addr_space
From: Stefan Schmidt @ 2016-05-03 18:17 UTC (permalink / raw)
To: Alexander Aring, linux-wpan
Cc: kernel, marcel, jukka.rissanen, hannes, mcr, werner,
linux-bluetooth, netdev, David S . Miller, Alexey Kuznetsov,
James Morris, Hideaki YOSHIFUJI, Patrick McHardy
In-Reply-To: <1461140382-4784-5-git-send-email-aar@pengutronix.de>
Hello.
On 20/04/16 10:19, Alexander Aring wrote:
> This patch makes the address length as argument for the
> ndisc_opt_addr_space function. This is necessary to handle addresses
> which don't use dev->addr_len as address length.
>
> Cc: David S. Miller<davem@davemloft.net>
> Cc: Alexey Kuznetsov<kuznet@ms2.inr.ac.ru>
> Cc: James Morris<jmorris@namei.org>
> Cc: Hideaki YOSHIFUJI<yoshfuji@linux-ipv6.org>
> Cc: Patrick McHardy<kaber@trash.net>
> Signed-off-by: Alexander Aring<aar@pengutronix.de>
> ---
> include/net/ndisc.h | 8 ++++----
> net/ipv6/ndisc.c | 10 +++++-----
> 2 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/include/net/ndisc.h b/include/net/ndisc.h
> index 2d8edaa..ef43e88 100644
> --- a/include/net/ndisc.h
> +++ b/include/net/ndisc.h
> @@ -127,10 +127,10 @@ static inline int ndisc_addr_option_pad(unsigned short type)
> }
> }
>
> -static inline int ndisc_opt_addr_space(struct net_device *dev)
> +static inline int ndisc_opt_addr_space(struct net_device *dev,
> + unsigned char addr_len)
> {
> - return NDISC_OPT_SPACE(dev->addr_len +
> - ndisc_addr_option_pad(dev->type));
> + return NDISC_OPT_SPACE(addr_len + ndisc_addr_option_pad(dev->type));
> }
>
> static inline u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p,
> @@ -139,7 +139,7 @@ static inline u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p,
> u8 *lladdr = (u8 *)(p + 1);
> int lladdrlen = p->nd_opt_len << 3;
> int prepad = ndisc_addr_option_pad(dev->type);
> - if (lladdrlen != ndisc_opt_addr_space(dev))
> + if (lladdrlen != ndisc_opt_addr_space(dev, dev->addr_len))
> return NULL;
> return lladdr + prepad;
> }
> diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
> index c245895..69e20e3 100644
> --- a/net/ipv6/ndisc.c
> +++ b/net/ipv6/ndisc.c
> @@ -154,7 +154,7 @@ static void ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data)
> {
> int pad = ndisc_addr_option_pad(skb->dev->type);
> int data_len = skb->dev->addr_len;
> - int space = ndisc_opt_addr_space(skb->dev);
> + int space = ndisc_opt_addr_space(skb->dev, skb->dev->addr_len);
> u8 *opt = skb_put(skb, space);
>
> opt[0] = type;
> @@ -509,7 +509,7 @@ void ndisc_send_na(struct net_device *dev, const struct in6_addr *daddr,
> if (!dev->addr_len)
> inc_opt = 0;
> if (inc_opt)
> - optlen += ndisc_opt_addr_space(dev);
> + optlen += ndisc_opt_addr_space(dev, dev->addr_len);
>
> skb = ndisc_alloc_skb(dev, sizeof(*msg) + optlen);
> if (!skb)
> @@ -574,7 +574,7 @@ void ndisc_send_ns(struct net_device *dev, const struct in6_addr *solicit,
> if (ipv6_addr_any(saddr))
> inc_opt = false;
> if (inc_opt)
> - optlen += ndisc_opt_addr_space(dev);
> + optlen += ndisc_opt_addr_space(dev, dev->addr_len);
>
> skb = ndisc_alloc_skb(dev, sizeof(*msg) + optlen);
> if (!skb)
> @@ -626,7 +626,7 @@ void ndisc_send_rs(struct net_device *dev, const struct in6_addr *saddr,
> }
> #endif
> if (send_sllao)
> - optlen += ndisc_opt_addr_space(dev);
> + optlen += ndisc_opt_addr_space(dev, dev->addr_len);
>
> skb = ndisc_alloc_skb(dev, sizeof(*msg) + optlen);
> if (!skb)
> @@ -1563,7 +1563,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
> memcpy(ha_buf, neigh->ha, dev->addr_len);
> read_unlock_bh(&neigh->lock);
> ha = ha_buf;
> - optlen += ndisc_opt_addr_space(dev);
> + optlen += ndisc_opt_addr_space(dev, dev->addr_len);
> } else
> read_unlock_bh(&neigh->lock);
>
Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>
regards
Stefan Schmidt
^ permalink raw reply
* Re: [PATCHv2 bluetooth-next 03/10] 6lowpan: remove ipv6 module request
From: Stefan Schmidt @ 2016-05-03 18:16 UTC (permalink / raw)
To: Alexander Aring, linux-wpan
Cc: kernel, marcel, jukka.rissanen, hannes, mcr, werner,
linux-bluetooth, netdev
In-Reply-To: <1461140382-4784-4-git-send-email-aar@pengutronix.de>
Hello.
On 20/04/16 10:19, Alexander Aring wrote:
> Since we use exported function from ipv6 kernel module we don't need to
> request the module anymore to have ipv6 functionality.
>
> Signed-off-by: Alexander Aring<aar@pengutronix.de>
> ---
> net/6lowpan/core.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/net/6lowpan/core.c b/net/6lowpan/core.c
> index fbae31e..824d1bc 100644
> --- a/net/6lowpan/core.c
> +++ b/net/6lowpan/core.c
> @@ -158,8 +158,6 @@ static int __init lowpan_module_init(void)
> return ret;
> }
>
> - request_module_nowait("ipv6");
> -
> request_module_nowait("nhc_dest");
> request_module_nowait("nhc_fragment");
> request_module_nowait("nhc_hop");
Good point.
Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>
regards
Stefan Schmidt
^ permalink raw reply
* Re: [PATCHv2 bluetooth-next 02/10] 6lowpan: add 802.15.4 short addr slaac
From: Stefan Schmidt @ 2016-05-03 18:16 UTC (permalink / raw)
To: Alexander Aring, linux-wpan-u79uwXL29TY76Z2rM5mHXA
Cc: kernel-bIcnvbaLZ9MEGnE8C9+IrQ, marcel-kz+m5ild9QBg9hUCZPvPmw,
jukka.rissanen-VuQAYsv1563Yd54FQh9/CA,
hannes-tFNcAqjVMyqKXQKiL6tip0B+6BGkLq7r,
mcr-SWp7JaYWvAQV+D8aMU/kSg, werner-SEdMjqphH88wryQfseakQg,
linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA, David S . Miller, Alexey Kuznetsov,
James Morris, Hideaki YOSHIFUJI, Patrick McHardy
In-Reply-To: <1461140382-4784-3-git-send-email-aar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Hello.
On 20/04/16 10:19, Alexander Aring wrote:
> This patch adds the autoconfiguration if a valid 802.15.4 short address
> is available for 802.15.4 6LoWPAN interfaces.
>
> Cc: David S. Miller<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
> Cc: Alexey Kuznetsov<kuznet-v/Mj1YrvjDBInbfyfbPRSQ@public.gmane.org>
> Cc: James Morris<jmorris-gx6/JNMH7DfYtjvyW6yDsg@public.gmane.org>
> Cc: Hideaki YOSHIFUJI<yoshfuji-VfPWfsRibaP+Ru+s062T9g@public.gmane.org>
> Cc: Patrick McHardy<kaber-dcUjhNyLwpNeoWH0uzbU5w@public.gmane.org>
> Signed-off-by: Alexander Aring<aar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> ---
> include/net/addrconf.h | 3 +++
> net/6lowpan/core.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
> net/ipv6/addrconf.c | 5 +++--
> 3 files changed, 52 insertions(+), 2 deletions(-)
>
> diff --git a/include/net/addrconf.h b/include/net/addrconf.h
> index 730d856..b1774eb 100644
> --- a/include/net/addrconf.h
> +++ b/include/net/addrconf.h
> @@ -94,6 +94,9 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2,
> void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr);
> void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr);
>
> +void addrconf_add_linklocal(struct inet6_dev *idev,
> + const struct in6_addr *addr, u32 flags);
> +
> static inline int addrconf_ifid_eui48(u8 *eui, struct net_device *dev)
> {
> if (dev->addr_len != ETH_ALEN)
> diff --git a/net/6lowpan/core.c b/net/6lowpan/core.c
> index 7a240b3..fbae31e 100644
> --- a/net/6lowpan/core.c
> +++ b/net/6lowpan/core.c
> @@ -14,6 +14,7 @@
> #include <linux/module.h>
>
> #include <net/6lowpan.h>
> +#include <net/addrconf.h>
>
> #include "6lowpan_i.h"
>
> @@ -72,16 +73,61 @@ void lowpan_unregister_netdev(struct net_device *dev)
> }
> EXPORT_SYMBOL(lowpan_unregister_netdev);
>
> +static int addrconf_ifid_802154_6lowpan(u8 *eui, struct net_device *dev)
> +{
> + struct wpan_dev *wpan_dev = lowpan_802154_dev(dev)->wdev->ieee802154_ptr;
> +
> + /* Set short_addr autoconfiguration if short_addr is present only */
> + if (!ieee802154_is_valid_src_short_addr(wpan_dev->short_addr))
> + return -1;
-EINVAL instead of -1?
> +
> + /* For either address format, all zero addresses MUST NOT be used */
> + if (wpan_dev->pan_id == cpu_to_le16(0x0000) &&
> + wpan_dev->short_addr == cpu_to_le16(0x0000))
> + return -1;
-EINVAL instead of -1?
> +
> + /* Alternatively, if no PAN ID is known, 16 zero bits may be used */
> + if (wpan_dev->pan_id == cpu_to_le16(IEEE802154_PAN_ID_BROADCAST))
> + memset(eui, 0, 2);
> + else
> + ieee802154_le16_to_be16(eui, &wpan_dev->pan_id);
> +
> + /* The "Universal/Local" (U/L) bit shall be set to zero */
> + eui[0] &= ~2;
> + eui[2] = 0;
> + eui[3] = 0xFF;
> + eui[4] = 0xFE;
> + eui[5] = 0;
> + ieee802154_le16_to_be16(&eui[6], &wpan_dev->short_addr);
> + return 0;
> +}
> +
> static int lowpan_event(struct notifier_block *unused,
> unsigned long event, void *ptr)
> {
> struct net_device *dev = netdev_notifier_info_to_dev(ptr);
> + struct inet6_dev *idev;
> + struct in6_addr addr;
> int i;
>
> if (dev->type != ARPHRD_6LOWPAN)
> return NOTIFY_DONE;
>
> + idev = __in6_dev_get(dev);
> + if (!idev)
> + return NOTIFY_DONE;
> +
> switch (event) {
> + case NETDEV_UP:
> + case NETDEV_CHANGE:
> + /* (802.15.4 6LoWPAN short address slaac handling */
> + if (lowpan_is_ll(dev, LOWPAN_LLTYPE_IEEE802154) &&
> + addrconf_ifid_802154_6lowpan(addr.s6_addr + 8, dev) == 0) {
I normally would like to get a define here instead of the magic number
8, but given how complex this if statement already is I think its fine
to keep it.
> + __ipv6_addr_set_half(&addr.s6_addr32[0],
> + htonl(0xFE800000), 0);
> + addrconf_add_linklocal(idev, &addr, 0);
> + }
> + break;
> case NETDEV_DOWN:
> for (i = 0; i < LOWPAN_IPHC_CTX_TABLE_SIZE; i++)
> clear_bit(LOWPAN_IPHC_CTX_FLAG_ACTIVE,
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 27aed1a..54e18c2 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -2948,8 +2948,8 @@ static void init_loopback(struct net_device *dev)
> }
> }
>
> -static void addrconf_add_linklocal(struct inet6_dev *idev,
> - const struct in6_addr *addr, u32 flags)
> +void addrconf_add_linklocal(struct inet6_dev *idev,
> + const struct in6_addr *addr, u32 flags)
> {
> struct inet6_ifaddr *ifp;
> u32 addr_flags = flags | IFA_F_PERMANENT;
> @@ -2968,6 +2968,7 @@ static void addrconf_add_linklocal(struct inet6_dev *idev,
> in6_ifa_put(ifp);
> }
> }
> +EXPORT_SYMBOL(addrconf_add_linklocal);
>
> static bool ipv6_reserved_interfaceid(struct in6_addr address)
> {
Reviewed-by: Stefan Schmidt<stefan-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
regards
Stefan Schmidt
^ permalink raw reply
* Re: [PATCHv2 bluetooth-next 01/10] 6lowpan: add private neighbour data
From: Stefan Schmidt @ 2016-05-03 18:16 UTC (permalink / raw)
To: Alexander Aring, linux-wpan
Cc: kernel, marcel, jukka.rissanen, hannes, mcr, werner,
linux-bluetooth, netdev, David S . Miller
In-Reply-To: <1461140382-4784-2-git-send-email-aar@pengutronix.de>
Hello.
On 20/04/16 10:19, Alexander Aring wrote:
> This patch will introduce a 6lowpan neighbour private data. Like the
> interface private data we handle private data for generic 6lowpan and
> for link-layer specific 6lowpan.
>
> The current first use case if to save the short address for a 802.15.4
> 6lowpan neighbour.
>
> Cc: David S. Miller<davem@davemloft.net>
> Signed-off-by: Alexander Aring<aar@pengutronix.de>
> ---
> include/linux/netdevice.h | 3 +--
> include/net/6lowpan.h | 24 ++++++++++++++++++++++++
> net/bluetooth/6lowpan.c | 2 ++
> net/ieee802154/6lowpan/core.c | 12 ++++++++++++
> 4 files changed, 39 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 166402a..0052c42 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -1487,8 +1487,7 @@ enum netdev_priv_flags {
> * @perm_addr: Permanent hw address
> * @addr_assign_type: Hw address assignment type
> * @addr_len: Hardware address length
> - * @neigh_priv_len; Used in neigh_alloc(),
> - * initialized only in atm/clip.c
> + * @neigh_priv_len; Used in neigh_alloc()
> * @dev_id: Used to differentiate devices that share
> * the same link layer address
> * @dev_port: Used to differentiate devices that share
> diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h
> index da84cf9..61c6517 100644
> --- a/include/net/6lowpan.h
> +++ b/include/net/6lowpan.h
> @@ -98,6 +98,9 @@ static inline bool lowpan_is_iphc(u8 dispatch)
> #define LOWPAN_PRIV_SIZE(llpriv_size) \
> (sizeof(struct lowpan_dev) + llpriv_size)
>
> +#define LOWPAN_NEIGH_PRIV_SIZE(llneigh_priv_size) \
> + (sizeof(struct lowpan_neigh) + llneigh_priv_size)
> +
> enum lowpan_lltypes {
> LOWPAN_LLTYPE_BTLE,
> LOWPAN_LLTYPE_IEEE802154,
> @@ -141,6 +144,27 @@ struct lowpan_dev {
> u8 priv[0] __aligned(sizeof(void *));
> };
>
> +struct lowpan_neigh {
> + /* 6LoWPAN neigh private data */
> + /* must be last */
> + u8 priv[0] __aligned(sizeof(void *));
> +};
> +
> +struct lowpan_802154_neigh {
> + __le16 short_addr;
> +};
> +
> +static inline struct lowpan_neigh *lowpan_neigh(void *neigh_priv)
> +{
> + return neigh_priv;
> +}
> +
> +static inline
> +struct lowpan_802154_neigh *lowpan_802154_neigh(void *neigh_priv)
> +{
> + return (struct lowpan_802154_neigh *)lowpan_neigh(neigh_priv)->priv;
> +}
> +
> static inline
> struct lowpan_dev *lowpan_dev(const struct net_device *dev)
> {
> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> index 38e82dd..b7c4efa 100644
> --- a/net/bluetooth/6lowpan.c
> +++ b/net/bluetooth/6lowpan.c
> @@ -833,6 +833,8 @@ static int setup_netdev(struct l2cap_chan *chan, struct lowpan_btle_dev **dev)
> list_add_rcu(&(*dev)->list, &bt_6lowpan_devices);
> spin_unlock(&devices_lock);
>
> + netdev->neigh_priv_len = LOWPAN_NEIGH_PRIV_SIZE(0);
> +
> err = lowpan_register_netdev(netdev, LOWPAN_LLTYPE_BTLE);
> if (err < 0) {
> BT_INFO("register_netdev failed %d", err);
> diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
> index dd085db..3162632 100644
> --- a/net/ieee802154/6lowpan/core.c
> +++ b/net/ieee802154/6lowpan/core.c
> @@ -92,11 +92,21 @@ static int lowpan_stop(struct net_device *dev)
> return 0;
> }
>
> +static int lowpan_neigh_construct(struct neighbour *n)
> +{
> + struct lowpan_802154_neigh *neigh = lowpan_802154_neigh(neighbour_priv(n));
> +
> + /* default no short_addr is available for a neighbour */
> + neigh->short_addr = cpu_to_le16(IEEE802154_ADDR_SHORT_UNSPEC);
> + return 0;
> +}
> +
> static const struct net_device_ops lowpan_netdev_ops = {
> .ndo_init = lowpan_dev_init,
> .ndo_start_xmit = lowpan_xmit,
> .ndo_open = lowpan_open,
> .ndo_stop = lowpan_stop,
> + .ndo_neigh_construct = lowpan_neigh_construct,
> };
>
> static void lowpan_setup(struct net_device *ldev)
> @@ -161,6 +171,8 @@ static int lowpan_newlink(struct net *src_net, struct net_device *ldev,
> wdev->needed_headroom;
> ldev->needed_tailroom = wdev->needed_tailroom;
>
> + ldev->neigh_priv_len = LOWPAN_NEIGH_PRIV_SIZE(sizeof(struct lowpan_802154_neigh));
> +
> ret = lowpan_register_netdevice(ldev, LOWPAN_LLTYPE_IEEE802154);
> if (ret < 0) {
> dev_put(wdev);
Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>
regards
Stefan Schmidt
^ permalink raw reply
* Re: [PATCH v1 net] net/mlx4: Avoid wrong virtual mappings
From: Or Gerlitz @ 2016-05-03 18:15 UTC (permalink / raw)
To: David Miller
Cc: Haggai Abramovsky, Linux Netdev List, Sinan Kaya, Timur Tabi,
Eran Ben Elisha, Yishai Hadas, talal@mellanox.com, Saeed Mahameed
In-Reply-To: <20160503.120032.1579415495628422336.davem@davemloft.net>
On Tue, May 3, 2016, David Miller <davem@davemloft.net> wrote:
> From: Or Gerlitz <gerlitz.or@gmail.com>
>> The patch changes the driver to do single allocation for potentially
>> very large HW WQE descriptor buffers such as those used by the RDMA
>> (mlx5_ib) driver.
> I know exactly what this patch does and how, but thanks for trying to
> teach me what it does anyways.
Dave,
This was more of a thinking out loud, not trying to teach you anything.
As I said, we're aiming for net-next, and as such the re-spin to
address your comment on bool vs int will be targeted there.
Or.
^ permalink raw reply
* Re: [PATCH nf-next 5/9] netfilter: conntrack: small refactoring of conntrack seq_printf
From: Pablo Neira Ayuso @ 2016-05-03 18:12 UTC (permalink / raw)
To: Florian Westphal; +Cc: netfilter-devel, netdev
In-Reply-To: <1461863628-23350-6-git-send-email-fw@strlen.de>
On Thu, Apr 28, 2016 at 07:13:44PM +0200, Florian Westphal wrote:
> The iteration process is lockless, so we test if the conntrack object is
> eligible for printing (e.g. is AF_INET) after obtaining the reference
> count.
>
> Once we put all conntracks into same hash table we might see more
> entries that need to be skipped.
>
> So add a helper and first perform the test in a lockless fashion
> for fast skip.
>
> Once we obtain the reference count, just repeat the check.
>
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
> .../netfilter/nf_conntrack_l3proto_ipv4_compat.c | 24 +++++++++++++++++-----
> 1 file changed, 19 insertions(+), 5 deletions(-)
>
> diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
> index f0dfe92..483cf79 100644
> --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
> +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
> @@ -114,6 +114,19 @@ static inline void ct_show_secctx(struct seq_file *s, const struct nf_conn *ct)
> }
> #endif
>
> +static bool ct_seq_should_skip(const struct nf_conn *ct,
> + const struct nf_conntrack_tuple_hash *hash)
> +{
> + /* we only want to print DIR_ORIGINAL */
> + if (NF_CT_DIRECTION(hash))
> + return true;
> +
> + if (nf_ct_l3num(ct) != AF_INET)
> + return true;
> +
> + return false;
> +}
> +
> static int ct_seq_show(struct seq_file *s, void *v)
> {
> struct nf_conntrack_tuple_hash *hash = v;
> @@ -123,14 +136,15 @@ static int ct_seq_show(struct seq_file *s, void *v)
> int ret = 0;
>
> NF_CT_ASSERT(ct);
> - if (unlikely(!atomic_inc_not_zero(&ct->ct_general.use)))
> + if (ct_seq_should_skip(ct, hash))
> return 0;
>
> + if (unlikely(!atomic_inc_not_zero(&ct->ct_general.use)))
> + return 0;
>
> - /* we only want to print DIR_ORIGINAL */
> - if (NF_CT_DIRECTION(hash))
> - goto release;
> - if (nf_ct_l3num(ct) != AF_INET)
> + /* check if we raced w. object reuse */
> + if (!nf_ct_is_confirmed(ct) ||
This refactoring includes this new check, is this intentional?
> + ct_seq_should_skip(ct, hash))
> goto release;
>
> l3proto = __nf_ct_l3proto_find(nf_ct_l3num(ct));
> --
> 2.7.3
>
^ permalink raw reply
* Re: [PATCH nf-next 3/9] netfilter: conntrack: don't attempt to iterate over empty table
From: Florian Westphal @ 2016-05-03 17:55 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: Florian Westphal, netfilter-devel, netdev
In-Reply-To: <20160503174144.GA3782@salvia>
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > I was thinking of the cleanup we do in the netns exit path
> > (in nf_conntrack_cleanup_net_list() ).
>
> Right, but in that path we still have entries in the table.
Not necessarily, they might have already been removed
(timeout, close).
> > If you don't like this I can move the check here:
> >
> > i_see_dead_people:
> > busy = 0;
> > list_for_each_entry(net, net_exit_list, exit_list) {
> > // here
> > if (atomic_read .. > 0)
> > nf_ct_iterate_cleanup(net, kill_all, ...
>
> I don't mind about placing this or there, as I said, my question is
> how often we will hit this optimization in a real scenario.
>
> If you think the answer is often, then this will help.
I think the extra atomic_read in this code does no harm and
saves us the entire scan. Also, in the exit path, when we hit the
'i_see_dead_people' label we restart the entire loop, so if we
have 200 netns on the list and the last one caused that restart,
we re-iterate needlesly for 199 netns...
> Otherwise, every time we'll go container destruction path, we'll hit
> slow path, ie. scanning the full table.
Yes, but I see no other choice.
^ permalink raw reply
* Re: [PATCH nf-next 3/9] netfilter: conntrack: don't attempt to iterate over empty table
From: Pablo Neira Ayuso @ 2016-05-03 17:41 UTC (permalink / raw)
To: Florian Westphal; +Cc: netfilter-devel, netdev
In-Reply-To: <20160503171744.GG2395@breakpoint.cc>
On Tue, May 03, 2016 at 07:17:44PM +0200, Florian Westphal wrote:
> Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > On Thu, Apr 28, 2016 at 07:13:42PM +0200, Florian Westphal wrote:
> > > Once we place all conntracks into same table iteration becomes more
> > > costly because the table contains conntracks that we are not interested
> > > in (belonging to other netns).
> > >
> > > So don't bother scanning if the current namespace has no entries.
> > >
> > > Signed-off-by: Florian Westphal <fw@strlen.de>
> > > ---
> > > net/netfilter/nf_conntrack_core.c | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
> > > index 29fa08b..f2e75a5 100644
> > > --- a/net/netfilter/nf_conntrack_core.c
> > > +++ b/net/netfilter/nf_conntrack_core.c
> > > @@ -1428,6 +1428,9 @@ void nf_ct_iterate_cleanup(struct net *net,
> > >
> > > might_sleep();
> > >
> > > + if (atomic_read(&net->ct.count) == 0)
> > > + return;
> >
> > This optimization gets defeated with just one single conntrack (ie.
> > net->ct.count == 1), so I wonder if this is practical thing.
>
> I was thinking of the cleanup we do in the netns exit path
> (in nf_conntrack_cleanup_net_list() ).
Right, but in that path we still have entries in the table.
> If you don't like this I can move the check here:
>
> i_see_dead_people:
> busy = 0;
> list_for_each_entry(net, net_exit_list, exit_list) {
> // here
> if (atomic_read .. > 0)
> nf_ct_iterate_cleanup(net, kill_all, ...
I don't mind about placing this or there, as I said, my question is
how often we will hit this optimization in a real scenario.
If you think the answer is often, then this will help.
Otherwise, every time we'll go container destruction path, we'll hit
slow path, ie. scanning the full table.
> > At the cost of consuming more memory per conntrack, we may consider
> > adding a per-net list so this iteration doesn't become a problem.
>
> I don't think that will be needed. We don't have any such iterations
> in the fast path.
>
> For dumps via ctnetlink it shouldn't be a big deal either, if needed
> we can optimize that to use rcu readlocks only and 'upgrade' to locked
> path only when we want to dump the candidate ct.
> for deferred pruning).
> early_drop will go away soon (i'll rework it to do the early_drop from
> work queue).
OK.
^ permalink raw reply
* [PATCH v2 net-next] dmfe: kill DEVICE define
From: Florian Westphal @ 2016-05-03 16:53 UTC (permalink / raw)
To: netdev; +Cc: Florian Westphal
use net_device directly. Compile tested, objdiff shows no changes.
Signed-off-by: Florian Westphal <fw@strlen.de>
---
resending this separately as it's not related to the
rest of the dev->trans_start removal series.
drivers/net/ethernet/dec/tulip/dmfe.c | 39 ++++++++++++++++-------------------
1 file changed, 18 insertions(+), 21 deletions(-)
diff --git a/drivers/net/ethernet/dec/tulip/dmfe.c b/drivers/net/ethernet/dec/tulip/dmfe.c
index afd8e78..42c759e 100644
--- a/drivers/net/ethernet/dec/tulip/dmfe.c
+++ b/drivers/net/ethernet/dec/tulip/dmfe.c
@@ -192,9 +192,6 @@
(__CHK_IO_SIZE(((pci_dev)->device << 16) | (pci_dev)->vendor, \
(pci_dev)->revision))
-/* Sten Check */
-#define DEVICE net_device
-
/* Structure/enum declaration ------------------------------- */
struct tx_desc {
__le32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */
@@ -313,10 +310,10 @@ static u8 SF_mode; /* Special Function: 1:VLAN, 2:RX Flow Control
/* function declaration ------------------------------------- */
-static int dmfe_open(struct DEVICE *);
-static netdev_tx_t dmfe_start_xmit(struct sk_buff *, struct DEVICE *);
-static int dmfe_stop(struct DEVICE *);
-static void dmfe_set_filter_mode(struct DEVICE *);
+static int dmfe_open(struct net_device *);
+static netdev_tx_t dmfe_start_xmit(struct sk_buff *, struct net_device *);
+static int dmfe_stop(struct net_device *);
+static void dmfe_set_filter_mode(struct net_device *);
static const struct ethtool_ops netdev_ethtool_ops;
static u16 read_srom_word(void __iomem *, int);
static irqreturn_t dmfe_interrupt(int , void *);
@@ -326,8 +323,8 @@ static void poll_dmfe (struct net_device *dev);
static void dmfe_descriptor_init(struct net_device *);
static void allocate_rx_buffer(struct net_device *);
static void update_cr6(u32, void __iomem *);
-static void send_filter_frame(struct DEVICE *);
-static void dm9132_id_table(struct DEVICE *);
+static void send_filter_frame(struct net_device *);
+static void dm9132_id_table(struct net_device *);
static u16 dmfe_phy_read(void __iomem *, u8, u8, u32);
static void dmfe_phy_write(void __iomem *, u8, u8, u16, u32);
static void dmfe_phy_write_1bit(void __iomem *, u32);
@@ -336,12 +333,12 @@ static u8 dmfe_sense_speed(struct dmfe_board_info *);
static void dmfe_process_mode(struct dmfe_board_info *);
static void dmfe_timer(unsigned long);
static inline u32 cal_CRC(unsigned char *, unsigned int, u8);
-static void dmfe_rx_packet(struct DEVICE *, struct dmfe_board_info *);
-static void dmfe_free_tx_pkt(struct DEVICE *, struct dmfe_board_info *);
+static void dmfe_rx_packet(struct net_device *, struct dmfe_board_info *);
+static void dmfe_free_tx_pkt(struct net_device *, struct dmfe_board_info *);
static void dmfe_reuse_skb(struct dmfe_board_info *, struct sk_buff *);
-static void dmfe_dynamic_reset(struct DEVICE *);
+static void dmfe_dynamic_reset(struct net_device *);
static void dmfe_free_rxbuffer(struct dmfe_board_info *);
-static void dmfe_init_dm910x(struct DEVICE *);
+static void dmfe_init_dm910x(struct net_device *);
static void dmfe_parse_srom(struct dmfe_board_info *);
static void dmfe_program_DM9801(struct dmfe_board_info *, int);
static void dmfe_program_DM9802(struct dmfe_board_info *);
@@ -558,7 +555,7 @@ static void dmfe_remove_one(struct pci_dev *pdev)
* The interface is opened whenever "ifconfig" actives it.
*/
-static int dmfe_open(struct DEVICE *dev)
+static int dmfe_open(struct net_device *dev)
{
struct dmfe_board_info *db = netdev_priv(dev);
const int irq = db->pdev->irq;
@@ -617,7 +614,7 @@ static int dmfe_open(struct DEVICE *dev)
* Enable Tx/Rx machine
*/
-static void dmfe_init_dm910x(struct DEVICE *dev)
+static void dmfe_init_dm910x(struct net_device *dev)
{
struct dmfe_board_info *db = netdev_priv(dev);
void __iomem *ioaddr = db->ioaddr;
@@ -684,7 +681,7 @@ static void dmfe_init_dm910x(struct DEVICE *dev)
*/
static netdev_tx_t dmfe_start_xmit(struct sk_buff *skb,
- struct DEVICE *dev)
+ struct net_device *dev)
{
struct dmfe_board_info *db = netdev_priv(dev);
void __iomem *ioaddr = db->ioaddr;
@@ -754,7 +751,7 @@ static netdev_tx_t dmfe_start_xmit(struct sk_buff *skb,
* The interface is stopped when it is brought.
*/
-static int dmfe_stop(struct DEVICE *dev)
+static int dmfe_stop(struct net_device *dev)
{
struct dmfe_board_info *db = netdev_priv(dev);
void __iomem *ioaddr = db->ioaddr;
@@ -798,7 +795,7 @@ static int dmfe_stop(struct DEVICE *dev)
static irqreturn_t dmfe_interrupt(int irq, void *dev_id)
{
- struct DEVICE *dev = dev_id;
+ struct net_device *dev = dev_id;
struct dmfe_board_info *db = netdev_priv(dev);
void __iomem *ioaddr = db->ioaddr;
unsigned long flags;
@@ -879,7 +876,7 @@ static void poll_dmfe (struct net_device *dev)
* Free TX resource after TX complete
*/
-static void dmfe_free_tx_pkt(struct DEVICE *dev, struct dmfe_board_info * db)
+static void dmfe_free_tx_pkt(struct net_device *dev, struct dmfe_board_info *db)
{
struct tx_desc *txptr;
void __iomem *ioaddr = db->ioaddr;
@@ -961,7 +958,7 @@ static inline u32 cal_CRC(unsigned char * Data, unsigned int Len, u8 flag)
* Receive the come packet and pass to upper layer
*/
-static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
+static void dmfe_rx_packet(struct net_device *dev, struct dmfe_board_info *db)
{
struct rx_desc *rxptr;
struct sk_buff *skb, *newskb;
@@ -1052,7 +1049,7 @@ static void dmfe_rx_packet(struct DEVICE *dev, struct dmfe_board_info * db)
* Set DM910X multicast address
*/
-static void dmfe_set_filter_mode(struct DEVICE * dev)
+static void dmfe_set_filter_mode(struct net_device *dev)
{
struct dmfe_board_info *db = netdev_priv(dev);
unsigned long flags;
--
2.7.3
^ permalink raw reply related
* Re: [PATCH net 0/4] Mellanox 100G mlx5 fixes for 4.6-rc
From: David Miller @ 2016-05-03 17:37 UTC (permalink / raw)
To: saeedm; +Cc: netdev, ogerlitz, talal, eranbe
In-Reply-To: <1462132797-22853-1-git-send-email-saeedm@mellanox.com>
From: Saeed Mahameed <saeedm@mellanox.com>
Date: Sun, 1 May 2016 22:59:53 +0300
> This small series provides some bug fixes for mlx5 driver.
>
> A small bug fix for iounmap of a null pointer, which dumps a warning on some archs.
>
> One patch to fix the VXLAN/MLX5_EN dependency issue reported by Arnd.
>
> Two patches to fix the scheduling while atomic issue for ndo_add/del_vxlan_port
> NDOs. The first will add an internal mlx5e workqueue and the second will
> delegate vxlan ports add/del requests to that workqueue.
>
> Note: ('net/mlx5: Kconfig: Fix MLX5_EN/VXLAN build issue') is only needed for net
> and not net-next as the issue was globally fixed for all device drivers by:
> b7aade15485a ('vxlan: break dependency with netdev drivers') in net-next.
>
> Applied on top: f27337e16f2d ('ip_tunnel: fix preempt warning in ip tunnel creation/updating')
Series applied, thanks.
^ permalink raw reply
* Re: [PATCH nf-next 3/9] netfilter: conntrack: don't attempt to iterate over empty table
From: Florian Westphal @ 2016-05-03 17:17 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: Florian Westphal, netfilter-devel, netdev
In-Reply-To: <20160503170357.GA21641@salvia>
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Thu, Apr 28, 2016 at 07:13:42PM +0200, Florian Westphal wrote:
> > Once we place all conntracks into same table iteration becomes more
> > costly because the table contains conntracks that we are not interested
> > in (belonging to other netns).
> >
> > So don't bother scanning if the current namespace has no entries.
> >
> > Signed-off-by: Florian Westphal <fw@strlen.de>
> > ---
> > net/netfilter/nf_conntrack_core.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
> > index 29fa08b..f2e75a5 100644
> > --- a/net/netfilter/nf_conntrack_core.c
> > +++ b/net/netfilter/nf_conntrack_core.c
> > @@ -1428,6 +1428,9 @@ void nf_ct_iterate_cleanup(struct net *net,
> >
> > might_sleep();
> >
> > + if (atomic_read(&net->ct.count) == 0)
> > + return;
>
> This optimization gets defeated with just one single conntrack (ie.
> net->ct.count == 1), so I wonder if this is practical thing.
I was thinking of the cleanup we do in the netns exit path
(in nf_conntrack_cleanup_net_list() ).
If you don't like this I can move the check here:
i_see_dead_people:
busy = 0;
list_for_each_entry(net, net_exit_list, exit_list) {
// here
if (atomic_read .. > 0)
nf_ct_iterate_cleanup(net, kill_all, ...
> At the cost of consuming more memory per conntrack, we may consider
> adding a per-net list so this iteration doesn't become a problem.
I don't think that will be needed. We don't have any such iterations
in the fast path.
For dumps via ctnetlink it shouldn't be a big deal either, if needed
we can optimize that to use rcu readlocks only and 'upgrade' to locked
path only when we want to dump the candidate ct.
for deferred pruning).
early_drop will go away soon (i'll rework it to do the early_drop from
work queue).
^ permalink raw reply
* Re: [PATCH 4/4] net: ethernet: fec_mpc52xx: move to new ethtool api {get|set}_link_ksettings
From: David Miller @ 2016-05-03 17:04 UTC (permalink / raw)
To: tremyfr
Cc: pantelis.antoniou, vbordug, claudiu.manoil, leoli, treding,
netdev, linux-kernel, linuxppc-dev
In-Reply-To: <1462115291-11372-4-git-send-email-tremyfr@gmail.com>
From: Philippe Reynes <tremyfr@gmail.com>
Date: Sun, 1 May 2016 17:08:11 +0200
> The ethtool api {get|set}_settings is deprecated.
> We move the fec_mpc52xx driver to new api {get|set}_link_ksettings.
>
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH 3/4] net: ethernet: fs-enet: move to new ethtool api {get|set}_link_ksettings
From: David Miller @ 2016-05-03 17:04 UTC (permalink / raw)
To: tremyfr
Cc: pantelis.antoniou, vbordug, claudiu.manoil, leoli, treding,
netdev, linux-kernel, linuxppc-dev
In-Reply-To: <1462115291-11372-3-git-send-email-tremyfr@gmail.com>
From: Philippe Reynes <tremyfr@gmail.com>
Date: Sun, 1 May 2016 17:08:10 +0200
> The ethtool api {get|set}_settings is deprecated.
> We move the fs-enet driver to new api {get|set}_link_ksettings.
>
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH 2/4] net: ethernet: ucc: move to new ethtool api {get|set}_link_ksettings
From: David Miller @ 2016-05-03 17:04 UTC (permalink / raw)
To: tremyfr
Cc: pantelis.antoniou, vbordug, claudiu.manoil, leoli, treding,
netdev, linux-kernel, linuxppc-dev
In-Reply-To: <1462115291-11372-2-git-send-email-tremyfr@gmail.com>
From: Philippe Reynes <tremyfr@gmail.com>
Date: Sun, 1 May 2016 17:08:09 +0200
> The ethtool api {get|set}_settings is deprecated.
> We move the ucc driver to new api {get|set}_link_ksettings.
>
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH 1/4] net: ethernet: gianfar: move to new ethtool api {get|set}_link_ksettings
From: David Miller @ 2016-05-03 17:04 UTC (permalink / raw)
To: tremyfr
Cc: pantelis.antoniou, vbordug, claudiu.manoil, leoli, treding,
netdev, linux-kernel, linuxppc-dev
In-Reply-To: <1462115291-11372-1-git-send-email-tremyfr@gmail.com>
From: Philippe Reynes <tremyfr@gmail.com>
Date: Sun, 1 May 2016 17:08:08 +0200
> The ethtool api {get|set}_settings is deprecated.
> We move the gianfar driver to new api {get|set}_link_ksettings.
>
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH nf-next 3/9] netfilter: conntrack: don't attempt to iterate over empty table
From: Pablo Neira Ayuso @ 2016-05-03 17:03 UTC (permalink / raw)
To: Florian Westphal; +Cc: netfilter-devel, netdev
In-Reply-To: <1461863628-23350-4-git-send-email-fw@strlen.de>
On Thu, Apr 28, 2016 at 07:13:42PM +0200, Florian Westphal wrote:
> Once we place all conntracks into same table iteration becomes more
> costly because the table contains conntracks that we are not interested
> in (belonging to other netns).
>
> So don't bother scanning if the current namespace has no entries.
>
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
> net/netfilter/nf_conntrack_core.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
> index 29fa08b..f2e75a5 100644
> --- a/net/netfilter/nf_conntrack_core.c
> +++ b/net/netfilter/nf_conntrack_core.c
> @@ -1428,6 +1428,9 @@ void nf_ct_iterate_cleanup(struct net *net,
>
> might_sleep();
>
> + if (atomic_read(&net->ct.count) == 0)
> + return;
This optimization gets defeated with just one single conntrack (ie.
net->ct.count == 1), so I wonder if this is practical thing.
At the cost of consuming more memory per conntrack, we may consider
adding a per-net list so this iteration doesn't become a problem.
> while ((ct = get_next_corpse(net, iter, data, &bucket)) != NULL) {
> /* Time to push up daises... */
> if (del_timer(&ct->timeout))
> --
> 2.7.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH RFT 1/2] phylib: add device reset GPIO support
From: Rob Herring @ 2016-05-03 17:03 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: grant.likely, devicetree, f.fainelli, netdev, frowand.list,
pawel.moll, mark.rutland, ijc+devicetree, galak, linux-kernel
In-Reply-To: <3641492.klKRrvS8tr@wasted.cogentembedded.com>
On Fri, Apr 29, 2016 at 01:12:54AM +0300, Sergei Shtylyov wrote:
> The PHY devices sometimes do have their reset signal (maybe even power
> supply?) tied to some GPIO and sometimes it also does happen that a boot
> loader does not leave it deasserted. So far this issue has been attacked
> from (as I believe) a wrong angle: by teaching the MAC driver to manipulate
> the GPIO in question; that solution, when applied to the device trees, led
> to adding the PHY reset GPIO properties to the MAC device node, with one
> exception: Cadence MACB driver which could handle the "reset-gpios" prop
> in a PHY device subnode. I believe that the correct approach is to teach
> the 'phylib' to get the MDIO device reset GPIO from the device tree node
> corresponding to this device -- which this patch is doing...
>
> Note that I had to modify the AT803x PHY driver as it would stop working
> otherwise as it made use of the reset GPIO for its own purposes...
>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>
> ---
> Changes in version 2:
> - reformatted the changelog;
> - resolved rejects, refreshed the patch.
>
> Documentation/devicetree/bindings/net/phy.txt | 2 +
> Documentation/devicetree/bindings/net/phy.txt | 2 +
Acked-by: Rob Herring <robh@kernel.org>
> drivers/net/phy/at803x.c | 19 ++------------
> drivers/net/phy/mdio_bus.c | 4 +++
> drivers/net/phy/mdio_device.c | 27 +++++++++++++++++++--
> drivers/net/phy/phy_device.c | 33 ++++++++++++++++++++++++--
> drivers/of/of_mdio.c | 16 ++++++++++++
> include/linux/mdio.h | 3 ++
> include/linux/phy.h | 5 +++
> 8 files changed, 89 insertions(+), 20 deletions(-)
>
> Index: net-next/Documentation/devicetree/bindings/net/phy.txt
> ===================================================================
> --- net-next.orig/Documentation/devicetree/bindings/net/phy.txt
> +++ net-next/Documentation/devicetree/bindings/net/phy.txt
> @@ -35,6 +35,8 @@ Optional Properties:
> - broken-turn-around: If set, indicates the PHY device does not correctly
> release the turn around line low at the end of a MDIO transaction.
>
> +- reset-gpios: The GPIO phandle and specifier for the PHY reset signal.
> +
> Example:
>
> ethernet-phy@0 {
> Index: net-next/drivers/net/phy/at803x.c
> ===================================================================
> --- net-next.orig/drivers/net/phy/at803x.c
> +++ net-next/drivers/net/phy/at803x.c
> @@ -65,7 +65,6 @@ MODULE_LICENSE("GPL");
>
> struct at803x_priv {
> bool phy_reset:1;
> - struct gpio_desc *gpiod_reset;
> };
>
> struct at803x_context {
> @@ -271,22 +270,10 @@ static int at803x_probe(struct phy_devic
> {
> struct device *dev = &phydev->mdio.dev;
> struct at803x_priv *priv;
> - struct gpio_desc *gpiod_reset;
>
> priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> if (!priv)
> return -ENOMEM;
> -
> - if (phydev->drv->phy_id != ATH8030_PHY_ID)
> - goto does_not_require_reset_workaround;
> -
> - gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
> - if (IS_ERR(gpiod_reset))
> - return PTR_ERR(gpiod_reset);
> -
> - priv->gpiod_reset = gpiod_reset;
> -
> -does_not_require_reset_workaround:
> phydev->priv = priv;
>
> return 0;
> @@ -361,14 +348,14 @@ static void at803x_link_change_notify(st
> */
> if (phydev->drv->phy_id == ATH8030_PHY_ID) {
> if (phydev->state == PHY_NOLINK) {
> - if (priv->gpiod_reset && !priv->phy_reset) {
> + if (phydev->mdio.reset && !priv->phy_reset) {
> struct at803x_context context;
>
> at803x_context_save(phydev, &context);
>
> - gpiod_set_value(priv->gpiod_reset, 1);
> + phy_device_reset(phydev, 1);
> msleep(1);
> - gpiod_set_value(priv->gpiod_reset, 0);
> + phy_device_reset(phydev, 0);
> msleep(1);
>
> at803x_context_restore(phydev, &context);
> Index: net-next/drivers/net/phy/mdio_bus.c
> ===================================================================
> --- net-next.orig/drivers/net/phy/mdio_bus.c
> +++ net-next/drivers/net/phy/mdio_bus.c
> @@ -35,6 +35,7 @@
> #include <linux/phy.h>
> #include <linux/io.h>
> #include <linux/uaccess.h>
> +#include <linux/gpio/consumer.h>
>
> #include <asm/irq.h>
>
> @@ -371,6 +372,9 @@ void mdiobus_unregister(struct mii_bus *
> if (!mdiodev)
> continue;
>
> + if (mdiodev->reset)
> + gpiod_put(mdiodev->reset);
> +
> mdiodev->device_remove(mdiodev);
> mdiodev->device_free(mdiodev);
> }
> Index: net-next/drivers/net/phy/mdio_device.c
> ===================================================================
> --- net-next.orig/drivers/net/phy/mdio_device.c
> +++ net-next/drivers/net/phy/mdio_device.c
> @@ -12,6 +12,8 @@
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> #include <linux/errno.h>
> +#include <linux/gpio.h>
> +#include <linux/gpio/consumer.h>
> #include <linux/init.h>
> #include <linux/interrupt.h>
> #include <linux/kernel.h>
> @@ -103,6 +105,13 @@ void mdio_device_remove(struct mdio_devi
> }
> EXPORT_SYMBOL(mdio_device_remove);
>
> +void mdio_device_reset(struct mdio_device *mdiodev, int value)
> +{
> + if (mdiodev->reset)
> + gpiod_set_value(mdiodev->reset, value);
> +}
> +EXPORT_SYMBOL(mdio_device_reset);
> +
> /**
> * mdio_probe - probe an MDIO device
> * @dev: device to probe
> @@ -117,9 +126,16 @@ static int mdio_probe(struct device *dev
> struct mdio_driver *mdiodrv = to_mdio_driver(drv);
> int err = 0;
>
> - if (mdiodrv->probe)
> + if (mdiodrv->probe) {
> + /* Deassert the reset signal */
> + mdio_device_reset(mdiodev, 0);
> +
> err = mdiodrv->probe(mdiodev);
>
> + /* Assert the reset signal */
> + mdio_device_reset(mdiodev, 1);
> + }
> +
> return err;
> }
>
> @@ -129,9 +145,16 @@ static int mdio_remove(struct device *de
> struct device_driver *drv = mdiodev->dev.driver;
> struct mdio_driver *mdiodrv = to_mdio_driver(drv);
>
> - if (mdiodrv->remove)
> + if (mdiodrv->remove) {
> + /* Deassert the reset signal */
> + mdio_device_reset(mdiodev, 0);
> +
> mdiodrv->remove(mdiodev);
>
> + /* Assert the reset signal */
> + mdio_device_reset(mdiodev, 1);
> + }
> +
> return 0;
> }
>
> Index: net-next/drivers/net/phy/phy_device.c
> ===================================================================
> --- net-next.orig/drivers/net/phy/phy_device.c
> +++ net-next/drivers/net/phy/phy_device.c
> @@ -589,6 +589,9 @@ int phy_device_register(struct phy_devic
> if (err)
> return err;
>
> + /* Deassert the reset signal */
> + phy_device_reset(phydev, 0);
> +
> /* Run all of the fixups for this PHY */
> err = phy_scan_fixups(phydev);
> if (err) {
> @@ -604,9 +607,15 @@ int phy_device_register(struct phy_devic
> goto out;
> }
>
> + /* Assert the reset signal */
> + phy_device_reset(phydev, 1);
> +
> return 0;
>
> out:
> + /* Assert the reset signal */
> + phy_device_reset(phydev, 1);
> +
> mdiobus_unregister_device(&phydev->mdio);
> return err;
> }
> @@ -792,6 +801,9 @@ int phy_init_hw(struct phy_device *phyde
> {
> int ret = 0;
>
> + /* Deassert the reset signal */
> + phy_device_reset(phydev, 0);
> +
> if (!phydev->drv || !phydev->drv->config_init)
> return 0;
>
> @@ -997,6 +1009,9 @@ void phy_detach(struct phy_device *phyde
>
> put_device(&phydev->mdio.dev);
> module_put(bus->owner);
> +
> + /* Assert the reset signal */
> + phy_device_reset(phydev, 1);
> }
> EXPORT_SYMBOL(phy_detach);
>
> @@ -1596,9 +1611,16 @@ static int phy_probe(struct device *dev)
> /* Set the state to READY by default */
> phydev->state = PHY_READY;
>
> - if (phydev->drv->probe)
> + if (phydev->drv->probe) {
> + /* Deassert the reset signal */
> + phy_device_reset(phydev, 0);
> +
> err = phydev->drv->probe(phydev);
>
> + /* Assert the reset signal */
> + phy_device_reset(phydev, 1);
> + }
> +
> mutex_unlock(&phydev->lock);
>
> return err;
> @@ -1612,8 +1634,15 @@ static int phy_remove(struct device *dev
> phydev->state = PHY_DOWN;
> mutex_unlock(&phydev->lock);
>
> - if (phydev->drv->remove)
> + if (phydev->drv->remove) {
> + /* Deassert the reset signal */
> + phy_device_reset(phydev, 0);
> +
> phydev->drv->remove(phydev);
> +
> + /* Assert the reset signal */
> + phy_device_reset(phydev, 1);
> + }
> phydev->drv = NULL;
>
> return 0;
> Index: net-next/drivers/of/of_mdio.c
> ===================================================================
> --- net-next.orig/drivers/of/of_mdio.c
> +++ net-next/drivers/of/of_mdio.c
> @@ -44,6 +44,7 @@ static int of_get_phy_id(struct device_n
> static void of_mdiobus_register_phy(struct mii_bus *mdio,
> struct device_node *child, u32 addr)
> {
> + struct gpio_desc *gpiod;
> struct phy_device *phy;
> bool is_c45;
> int rc;
> @@ -52,10 +53,17 @@ static void of_mdiobus_register_phy(stru
> is_c45 = of_device_is_compatible(child,
> "ethernet-phy-ieee802.3-c45");
>
> + gpiod = fwnode_get_named_gpiod(&child->fwnode, "reset-gpios");
> + /* Deassert the reset signal */
> + if (!IS_ERR(gpiod))
> + gpiod_direction_output(gpiod, 0);
> if (!is_c45 && !of_get_phy_id(child, &phy_id))
> phy = phy_device_create(mdio, addr, phy_id, 0, NULL);
> else
> phy = get_phy_device(mdio, addr, is_c45);
> + /* Assert the reset signal again */
> + if (!IS_ERR(gpiod))
> + gpiod_set_value(gpiod, 1);
> if (IS_ERR(phy))
> return;
>
> @@ -75,6 +83,9 @@ static void of_mdiobus_register_phy(stru
> of_node_get(child);
> phy->mdio.dev.of_node = child;
>
> + if (!IS_ERR(gpiod))
> + phy->mdio.reset = gpiod;
> +
> /* All data is now stored in the phy struct;
> * register it */
> rc = phy_device_register(phy);
> @@ -92,6 +103,7 @@ static void of_mdiobus_register_device(s
> struct device_node *child, u32 addr)
> {
> struct mdio_device *mdiodev;
> + struct gpio_desc *gpiod;
> int rc;
>
> mdiodev = mdio_device_create(mdio, addr);
> @@ -104,6 +116,10 @@ static void of_mdiobus_register_device(s
> of_node_get(child);
> mdiodev->dev.of_node = child;
>
> + gpiod = fwnode_get_named_gpiod(&child->fwnode, "reset-gpios");
> + if (!IS_ERR(gpiod))
> + mdiodev->reset = gpiod;
> +
> /* All data is now stored in the mdiodev struct; register it. */
> rc = mdio_device_register(mdiodev);
> if (rc) {
> Index: net-next/include/linux/mdio.h
> ===================================================================
> --- net-next.orig/include/linux/mdio.h
> +++ net-next/include/linux/mdio.h
> @@ -11,6 +11,7 @@
>
> #include <uapi/linux/mdio.h>
>
> +struct gpio_desc;
> struct mii_bus;
>
> /* Multiple levels of nesting are possible. However typically this is
> @@ -37,6 +38,7 @@ struct mdio_device {
> /* Bus address of the MDIO device (0-31) */
> int addr;
> int flags;
> + struct gpio_desc *reset;
> };
> #define to_mdio_device(d) container_of(d, struct mdio_device, dev)
>
> @@ -69,6 +71,7 @@ void mdio_device_free(struct mdio_device
> struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr);
> int mdio_device_register(struct mdio_device *mdiodev);
> void mdio_device_remove(struct mdio_device *mdiodev);
> +void mdio_device_reset(struct mdio_device *mdiodev, int value);
> int mdio_driver_register(struct mdio_driver *drv);
> void mdio_driver_unregister(struct mdio_driver *drv);
>
> Index: net-next/include/linux/phy.h
> ===================================================================
> --- net-next.orig/include/linux/phy.h
> +++ net-next/include/linux/phy.h
> @@ -769,6 +769,11 @@ static inline int phy_read_status(struct
> return phydev->drv->read_status(phydev);
> }
>
> +static inline void phy_device_reset(struct phy_device *phydev, int value)
> +{
> + mdio_device_reset(&phydev->mdio, value);
> +}
> +
> #define phydev_err(_phydev, format, args...) \
> dev_err(&_phydev->mdio.dev, format, ##args)
>
>
^ permalink raw reply
* Re: [PATCH] VSOCK: constify vsock_transport structure
From: David Miller @ 2016-05-03 17:03 UTC (permalink / raw)
To: Julia.Lawall
Cc: kernel-janitors, rjui, sbranden, jonmason, netdev,
linux-arm-kernel, bcm-kernel-feedback-list, linux-kernel
In-Reply-To: <1462106955-22131-1-git-send-email-Julia.Lawall@lip6.fr>
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 1 May 2016 14:49:15 +0200
> The vsock_transport structure is never modified, so declare it as const.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Applied.
^ permalink raw reply
* Re: [PATCH] drivers: net: xgene: constify xgene_cle_ops structure
From: David Miller @ 2016-05-03 17:03 UTC (permalink / raw)
To: Julia.Lawall
Cc: isubramanian, kernel-janitors, kchudgar, netdev, linux-kernel
In-Reply-To: <1462106189-14277-1-git-send-email-Julia.Lawall@lip6.fr>
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 1 May 2016 14:36:28 +0200
> The xgene_cle_ops structure is never modified, so declare it as const.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Applied.
^ permalink raw reply
* Re: [PATCH v3 net-next 2/2] net: ethernet: enc28j60: add device tree support
From: Rob Herring @ 2016-05-03 16:51 UTC (permalink / raw)
To: Michael Heimpold
Cc: Jonathan Cameron, Andrew F . Davis, Mark Brown, netdev,
devicetree, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala
In-Reply-To: <1461873975-6368-3-git-send-email-mhei@heimpold.de>
On Thu, Apr 28, 2016 at 10:06:15PM +0200, Michael Heimpold wrote:
> The following patch adds the required match table for device tree support
> (and while at, fix the indent). It's also possible to specify the
> MAC address in the DT blob.
>
> Also add the corresponding binding documentation file.
>
> Signed-off-by: Michael Heimpold <mhei@heimpold.de>
> ---
>
> Changelog:
>
> v3: * renamed and improved binding documentation as
> suggested by Rob Herring
>
> v2: * took care of Arnd Bergmann's review comments
> - allow to specify MAC address via DT
> - unconditionally define DT id table
> * increased the driver version minor number
> * driver author's email address bounces, removed from address list
>
> v1: * Initial submission
>
>
> .../devicetree/bindings/net/microchip,enc28j60.txt | 59 ++++++++++++++++++++++
Acked-by: Rob Herring <robh@kernel.org>
> drivers/net/ethernet/microchip/enc28j60.c | 20 ++++++--
> 2 files changed, 76 insertions(+), 3 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/net/microchip,enc28j60.txt
^ permalink raw reply
* Re: [PATCH 0/2] sctp: Add GSO support
From: Marcelo Ricardo Leitner @ 2016-05-03 16:47 UTC (permalink / raw)
To: David Miller
Cc: netdev, vyasevich, nhorman, linux-sctp, David.Laight,
alexander.duyck
In-Reply-To: <20160503.120915.2184693151751282220.davem@davemloft.net>
On Tue, May 03, 2016 at 12:09:15PM -0400, David Miller wrote:
> From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> Date: Tue, 3 May 2016 08:49:18 -0300
>
> > So this is just for pure tx path, no forwarding involved.
>
> And if that GSO segment is looped back into the stack via the
> loopback interface, the packet classifier mirror action, or
> netfilter?
>
> You cannot just GSO things and then not handle such packets
> properly on receive.
Good point. It will fail if one uses AUTH due to the reason I mentioned
for GRO. I have to split the GSO packet upon rx too and that should do
it. Will post a v2 when I have it.
Thanks,
Marcelo
^ permalink raw reply
* Re: [PATCH v5 1/2] can: rcar_canfd: Add Renesas R-Car CAN FD driver
From: Rob Herring @ 2016-05-03 16:47 UTC (permalink / raw)
To: Ramesh Shanmugasundaram
Cc: mkl, wg, socketcan, pawel.moll, mark.rutland, ijc+devicetree,
galak, linux-renesas-soc, devicetree, linux-can, netdev,
chris.paterson2
In-Reply-To: <1461846188-31249-2-git-send-email-ramesh.shanmugasundaram@bp.renesas.com>
On Thu, Apr 28, 2016 at 01:23:07PM +0100, Ramesh Shanmugasundaram wrote:
> This patch adds support for the CAN FD controller found in Renesas R-Car
> SoCs. The controller operates in CAN FD only mode by default.
>
> CAN FD mode supports both Classical CAN & CAN FD frame formats. The
> controller supports ISO 11898-1:2015 CAN FD format only.
>
> This controller supports two channels and the driver can enable either
> or both of the channels.
>
> Driver uses Rx FIFOs (one per channel) for reception & Common FIFOs (one
> per channel) for transmission. Rx filter rules are configured to the
> minimum (one per channel) and it accepts Standard, Extended, Data &
> Remote Frame combinations.
>
> Note: There are few documentation errors in R-Car Gen3 Hardware User
> Manual v0.5E with respect to CAN FD controller. They are listed below:
>
> 1. CAN FD interrupt numbers 29 & 30 are listed as per channel
> interrupts. However, they are common to both channels (i.e.) they are
> global and channel interrupts respectively.
>
> 2. CANFD clock is derived from PLL1. This is not documented.
>
> 3. CANFD clock is further divided by (1/2) within the CAN FD controller.
> This is not documented.
>
> 4. The minimum value of NTSEG1 in RSCFDnCFDCmNCFG register is 2 Tq. It
> is specified 4 Tq in the manual.
>
> 5. The maximum number of message RAM area the controller can use is 3584
> bytes. It is specified 10752 bytes in the manual.
>
> Signed-off-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
> ---
> .../devicetree/bindings/net/can/rcar_canfd.txt | 89 ++
What happened to my ack?
> drivers/net/can/Kconfig | 1 +
> drivers/net/can/Makefile | 1 +
> drivers/net/can/rcar/Kconfig | 11 +
> drivers/net/can/rcar/Makefile | 5 +
> drivers/net/can/rcar/rcar_canfd.c | 1624 ++++++++++++++++++++
> 6 files changed, 1731 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/net/can/rcar_canfd.txt
> create mode 100644 drivers/net/can/rcar/Kconfig
> create mode 100644 drivers/net/can/rcar/Makefile
> create mode 100644 drivers/net/can/rcar/rcar_canfd.c
^ permalink raw reply
* Re: [PATCH net-next] fq_codel: add batch ability to fq_codel_drop()
From: David Miller @ 2016-05-03 16:47 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, dave.taht, chromatix99
In-Reply-To: <1462146446.5535.236.camel@edumazet-glaptop3.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 01 May 2016 16:47:26 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> In presence of inelastic flows and stress, we can call
> fq_codel_drop() for every packet entering fq_codel qdisc.
>
> fq_codel_drop() is quite expensive, as it does a linear scan
> of 4 KB of memory to find a fat flow.
> Once found, it drops the oldest packet of this flow.
>
> Instead of dropping a single packet, try to drop 50% of the backlog
> of this fat flow, with a configurable limit of 64 packets per round.
>
> TCA_FQ_CODEL_DROP_BATCH_SIZE is the new attribute to make this
> limit configurable.
>
> With this strategy the 4 KB search is amortized to a single cache line
> per drop [1], so fq_codel_drop() no longer appears at the top of kernel
> profile in presence of few inelastic flows.
>
> [1] Assuming a 64byte cache line, and 1024 buckets
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Dave Taht <dave.taht@gmail.com>
> Cc: Jonathan Morton <chromatix99@gmail.com>
Applied, thanks Eric.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox