* [PATCH 1/3] bridge: Add a default_pvid sysfs attribute
From: Vladislav Yasevich @ 2014-09-12 20:44 UTC (permalink / raw)
To: netdev; +Cc: shemminger, bridge, Toshiaki Makita, Vladislav Yasevich
In-Reply-To: <1410554691-18467-1-git-send-email-vyasevic@redhat.com>
This patch allows the user to set and retrieve default_pvid
value. A new value can only be stored when vlan filtering
is disabled.
Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
---
net/bridge/br_private.h | 2 ++
net/bridge/br_sysfs_br.c | 17 +++++++++++++++++
net/bridge/br_vlan.c | 28 ++++++++++++++++++++++++++++
3 files changed, 47 insertions(+)
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 62a7fa2..84c9a5d 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -299,6 +299,7 @@ struct net_bridge
#ifdef CONFIG_BRIDGE_VLAN_FILTERING
u8 vlan_enabled;
__be16 vlan_proto;
+ u16 default_pvid;
struct net_port_vlans __rcu *vlan_info;
#endif
};
@@ -602,6 +603,7 @@ void br_recalculate_fwd_mask(struct net_bridge *br);
int br_vlan_filter_toggle(struct net_bridge *br, unsigned long val);
int br_vlan_set_proto(struct net_bridge *br, unsigned long val);
void br_vlan_init(struct net_bridge *br);
+int br_vlan_set_default_pvid(struct net_bridge *br, unsigned long val);
int nbp_vlan_add(struct net_bridge_port *port, u16 vid, u16 flags);
int nbp_vlan_delete(struct net_bridge_port *port, u16 vid);
void nbp_vlan_flush(struct net_bridge_port *port);
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index c9e2572..b969d9e 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -725,6 +725,22 @@ static ssize_t vlan_protocol_store(struct device *d,
return store_bridge_parm(d, buf, len, br_vlan_set_proto);
}
static DEVICE_ATTR_RW(vlan_protocol);
+
+static ssize_t default_pvid_show(struct device *d,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct net_bridge *br = to_bridge(d);
+ return sprintf(buf, "%d\n", br->default_pvid);
+}
+
+static ssize_t default_pvid_store(struct device *d,
+ struct device_attribute *attr,
+ const char *buf, size_t len)
+{
+ return store_bridge_parm(d, buf, len, br_vlan_set_default_pvid);
+}
+static DEVICE_ATTR_RW(default_pvid);
#endif
static struct attribute *bridge_attrs[] = {
@@ -771,6 +787,7 @@ static struct attribute *bridge_attrs[] = {
#ifdef CONFIG_BRIDGE_VLAN_FILTERING
&dev_attr_vlan_filtering.attr,
&dev_attr_vlan_protocol.attr,
+ &dev_attr_default_pvid.attr,
#endif
NULL
};
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index e1bcd65..43a297b 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -489,9 +489,37 @@ err_filt:
goto unlock;
}
+int br_vlan_set_default_pvid(struct net_bridge *br, unsigned long val)
+{
+ u16 pvid = val;
+ int err = 0;
+
+ if (!pvid || pvid >= VLAN_VID_MASK)
+ return -EINVAL;
+
+ if (!rtnl_trylock())
+ return restart_syscall();
+
+ if (pvid == br->default_pvid)
+ goto unlock;
+
+ /* Only allow default pvid change when filtering is disabled */
+ if (br->vlan_enabled) {
+ err = -EPERM;
+ goto unlock;
+ }
+
+ br->default_pvid = vid;
+
+unlock:
+ rtnl_unlock();
+ return err;
+}
+
void br_vlan_init(struct net_bridge *br)
{
br->vlan_proto = htons(ETH_P_8021Q);
+ br->default_pvid = 1;
}
/* Must be protected by RTNL.
--
1.9.3
^ permalink raw reply related
* [PATCH 0/3] bridge: Some nice new things for vlan filtering
From: Vladislav Yasevich @ 2014-09-12 20:44 UTC (permalink / raw)
To: netdev; +Cc: Vladislav Yasevich, shemminger, bridge
While working with vlan filtering and non-promisc mode, I've found
myself wanting untagged traffic to automatically pass through the
bridge. So I decided to introduce the concept of a per bridge default
pvid. VLAN 1 is used as default pvid by default and can be changed
by user through sysfs while vlan filtering is off. (I'll be adding netlink
support now that Jiri Pirko kindly added the ifrastructure). Default
pvid is assigned to all ports that do not assign their own pvid or
already have a given vlan configured. This makes it very simple
to enable vlan filtering on the bridge, not have to configure a thing,
and still pass untagged traffic.
The other small thing this series adds is automatic update of the
vlan filter when vlan is configured on top of the bridge. In this
case we automatically add the given vlan to the bridge filter list.
The ports may still need to be updated as we don't know which ports
are allowed to receive a given vlan.
Thanks
-vlad
Vladislav Yasevich (3):
bridge: Add a default_pvid sysfs attribute
bridge: Add filtering support for default_pvid
bridge; Automatically filter vlans configured on top of bridge
net/bridge/br_device.c | 54 +++++++++++++++++++---
net/bridge/br_if.c | 2 +
net/bridge/br_private.h | 35 ++++++++++++++-
net/bridge/br_sysfs_br.c | 17 +++++++
net/bridge/br_vlan.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++-
5 files changed, 213 insertions(+), 8 deletions(-)
--
1.9.3
^ permalink raw reply
* Re: [net-next v5 1/3] udp-tunnel: Expand UDP tunnel APIs
From: Andy Zhou @ 2014-09-12 20:42 UTC (permalink / raw)
To: Tom Herbert; +Cc: David Miller, Linux Netdev List
In-Reply-To: <CA+mtBx9FLLofOQZ_VRvnPhSoHhXv+3hC=p25LkQMgrgofrnFwg@mail.gmail.com>
On Thu, Sep 11, 2014 at 2:04 PM, Tom Herbert <therbert@google.com> wrote:
> On Wed, Sep 10, 2014 at 8:29 PM, Andy Zhou <azhou@nicira.com> wrote:
>> Added common udp tunnel socket creation, and packet transmission APIs
>> API that can be used by other UDP based tunneling protocol
>> implementation.
>>
>> Signed-off-by: Andy Zhou <azhou@nicira.com>
>> ---
>> include/net/udp_tunnel.h | 73 +++++++++++++++++++++++++++
>> net/ipv4/Kconfig | 1 +
>> net/ipv4/udp_tunnel.c | 108 ++++++++++++++++++++++++++--------------
>> net/ipv6/Makefile | 1 +
>> net/ipv6/ip6_udp_tunnel.c | 121 +++++++++++++++++++++++++++++++++++++++++++++
>> 5 files changed, 268 insertions(+), 36 deletions(-)
>> create mode 100644 net/ipv6/ip6_udp_tunnel.c
>>
>> diff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h
>> index ffd69cb..e9dcf83 100644
>> --- a/include/net/udp_tunnel.h
>> +++ b/include/net/udp_tunnel.h
>> @@ -1,6 +1,14 @@
>> #ifndef __NET_UDP_TUNNEL_H
>> #define __NET_UDP_TUNNEL_H
>>
>> +#include <net/ip_tunnels.h>
>> +#include <net/udp.h>
>> +
>> +#if IS_ENABLED(CONFIG_IPV6)
>> +#include <net/ipv6.h>
>> +#include <net/addrconf.h>
>> +#endif
>> +
>> struct udp_port_cfg {
>> u8 family;
>>
>> @@ -29,4 +37,69 @@ struct udp_port_cfg {
>> int udp_sock_create(struct net *net, struct udp_port_cfg *cfg,
>> struct socket **sockp);
>>
>> +#if IS_ENABLED(CONFIG_IPV6)
>> +int udp_sock_create6(struct net *net, struct udp_port_cfg *cfg,
>> + struct socket **sockp);
>> +#else
>> +static inline int udp_sock_create6(struct net *net, struct udp_port_cfg *cfg,
>> + struct socket **sockp)
>> +{
>> + return 0;
>> +}
>> +#endif
>> +
>> +struct udp_tunnel_sock;
>> +
>> +typedef int (*udp_tunnel_encap_rcv_t)(struct sock *sk, struct sk_buff *skb);
>> +typedef void (*udp_tunnel_encap_destroy_t)(struct sock *sk);
>> +
>> +struct udp_tunnel_sock_cfg {
>> + struct socket *sock; /* The socket UDP tunnel will attach to */
>> + /* Used for setting up udp_sock fields, see udp.h for details */
>> + __u8 encap_type;
>> + udp_tunnel_encap_rcv_t encap_rcv;
>> + udp_tunnel_encap_destroy_t encap_destroy;
>> +};
>> +
>> +struct udp_tunnel_sock {
>> + struct socket *sock;
>> +};
>> +
>> +struct udp_tunnel_sock *create_udp_tunnel_sock(struct net *net, size_t size,
>> + struct udp_tunnel_sock_cfg
>> + *sock_cfg);
>> +
>> +int udp_tunnel_xmit_skb(struct udp_tunnel_sock *uts, struct rtable *rt,
>> + struct sk_buff *skb, __be32 src, __be32 dst,
>> + __u8 tos, __u8 ttl, __be16 df, __be16 src_port,
>> + __be16 dst_port, bool xnet);
>> +
>> +#if IS_ENABLED(CONFIG_IPV6)
>> +int udp_tunnel6_xmit_skb(struct udp_tunnel_sock *uts, struct dst_entry *dst,
>> + struct sk_buff *skb, struct net_device *dev,
>> + struct in6_addr *saddr, struct in6_addr *daddr,
>> + __u8 prio, __u8 ttl, __be16 src_port,
>> + __be16 dst_port);
>> +#endif
>> +
>> +void udp_tunnel_sock_release(struct udp_tunnel_sock *uts);
>> +void udp_tunnel_sock_free(struct udp_tunnel_sock *uts);
>> +
>> +static inline struct sk_buff *udp_tunnel_handle_offloads(struct sk_buff *skb,
>> + bool udp_csum)
>> +{
>> + int type = udp_csum ? SKB_GSO_UDP_TUNNEL_CSUM : SKB_GSO_UDP_TUNNEL;
>> +
>> + return iptunnel_handle_offloads(skb, udp_csum, type);
>> +}
>> +
>> +static inline void udp_tunnel_encap_enable(struct socket *sock)
>> +{
>> +#if IS_ENABLED(CONFIG_IPV6)
>> + if (sock->sk->sk_family == PF_INET6)
>> + ipv6_stub->udpv6_encap_enable();
>> + else
>> +#endif
>> + udp_encap_enable();
>> +}
>> #endif
>> diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
>> index dbc10d8..cccb95f 100644
>> --- a/net/ipv4/Kconfig
>> +++ b/net/ipv4/Kconfig
>> @@ -308,6 +308,7 @@ config NET_IPVTI
>> on top.
>>
>> config NET_UDP_TUNNEL
>> + depends on (IPV6 || IPV6=n)
>> tristate
>> default n
>>
>> diff --git a/net/ipv4/udp_tunnel.c b/net/ipv4/udp_tunnel.c
>> index 61ec1a6..d60c1a0 100644
>> --- a/net/ipv4/udp_tunnel.c
>> +++ b/net/ipv4/udp_tunnel.c
>> @@ -14,42 +14,9 @@ int udp_sock_create(struct net *net, struct udp_port_cfg *cfg,
>> int err = -EINVAL;
>> struct socket *sock = NULL;
>>
>> -#if IS_ENABLED(CONFIG_IPV6)
>> if (cfg->family == AF_INET6) {
>> - struct sockaddr_in6 udp6_addr;
>> -
>> - err = sock_create_kern(AF_INET6, SOCK_DGRAM, 0, &sock);
>> - if (err < 0)
>> - goto error;
>> -
>> - sk_change_net(sock->sk, net);
>> -
>> - udp6_addr.sin6_family = AF_INET6;
>> - memcpy(&udp6_addr.sin6_addr, &cfg->local_ip6,
>> - sizeof(udp6_addr.sin6_addr));
>> - udp6_addr.sin6_port = cfg->local_udp_port;
>> - err = kernel_bind(sock, (struct sockaddr *)&udp6_addr,
>> - sizeof(udp6_addr));
>> - if (err < 0)
>> - goto error;
>> -
>> - if (cfg->peer_udp_port) {
>> - udp6_addr.sin6_family = AF_INET6;
>> - memcpy(&udp6_addr.sin6_addr, &cfg->peer_ip6,
>> - sizeof(udp6_addr.sin6_addr));
>> - udp6_addr.sin6_port = cfg->peer_udp_port;
>> - err = kernel_connect(sock,
>> - (struct sockaddr *)&udp6_addr,
>> - sizeof(udp6_addr), 0);
>> - }
>> - if (err < 0)
>> - goto error;
>> -
>> - udp_set_no_check6_tx(sock->sk, !cfg->use_udp6_tx_checksums);
>> - udp_set_no_check6_rx(sock->sk, !cfg->use_udp6_rx_checksums);
>> - } else
>> -#endif
>> - if (cfg->family == AF_INET) {
>> + return udp_sock_create6(net, cfg, sockp);
>> + } else if (cfg->family == AF_INET) {
>> struct sockaddr_in udp_addr;
>>
>> err = sock_create_kern(AF_INET, SOCK_DGRAM, 0, &sock);
>> @@ -82,7 +49,6 @@ int udp_sock_create(struct net *net, struct udp_port_cfg *cfg,
>> return -EPFNOSUPPORT;
>> }
>>
>> -
>> *sockp = sock;
>>
>> return 0;
>> @@ -97,4 +63,74 @@ error:
>> }
>> EXPORT_SYMBOL(udp_sock_create);
>>
>> +struct udp_tunnel_sock *
>> +create_udp_tunnel_sock(struct net *net, size_t size,
>> + struct udp_tunnel_sock_cfg *cfg)
>> +{
>> + struct udp_tunnel_sock *uts;
>> + struct sock *sk;
>> + struct socket *sock = cfg->sock;
>> +
>> + uts = kzalloc(size, GFP_KERNEL);
>> + if (!uts)
>> + return ERR_PTR(-ENOMEM);
>> +
> Allocating memory for the caller seems like overkill to me and there's
> no guarantee that is what caller wants anyway (maybe they are using
> array of static structures for instance). Seems like it would be just
> as easy to return the sock and let caller allocate whatever else it
> needs on its own (only field in udp_tunnel_sock is the sock anyway).
O.K. udp_tunnel layer does not need to allocate or maintain memory. It
will further simplify this layer.
>
>> + sk = sock->sk;
>> +
>> + /* Disable multicast loopback */
>> + inet_sk(sk)->mc_loop = 0;
>> +
> Probably want to enable checksum unnecessary conversions also.
Right. Will do.
>
>> + rcu_assign_sk_user_data(sk, uts);
>> +
>> + udp_sk(sk)->encap_type = cfg->encap_type;
>> + udp_sk(sk)->encap_rcv = cfg->encap_rcv;
>> + udp_sk(sk)->encap_destroy = cfg->encap_destroy;
>> +
>> + uts->sock = sock;
>> +
>> + udp_tunnel_encap_enable(sock);
>> +
>> + return uts;
>> +}
>> +EXPORT_SYMBOL_GPL(create_udp_tunnel_sock);
>> +
>> +int udp_tunnel_xmit_skb(struct udp_tunnel_sock *uts, struct rtable *rt,
>> + struct sk_buff *skb, __be32 src, __be32 dst,
>> + __u8 tos, __u8 ttl, __be16 df, __be16 src_port,
>> + __be16 dst_port, bool xnet)
>> +{
>> + struct udphdr *uh;
>> + struct socket *sock = uts->sock;
>> +
>> + __skb_push(skb, sizeof(*uh));
>> + skb_reset_transport_header(skb);
>> + uh = udp_hdr(skb);
>> +
>> + uh->dest = dst_port;
>> + uh->source = src_port;
>> + uh->len = htons(skb->len);
>> +
>> + udp_set_csum(sock->sk->sk_no_check_tx, skb, src, dst, skb->len);
>> +
>> + return iptunnel_xmit(sock->sk, rt, skb, src, dst, IPPROTO_UDP,
>> + tos, ttl, df, xnet);
>> +}
>> +EXPORT_SYMBOL_GPL(udp_tunnel_xmit_skb);
>> +
>> +void udp_tunnel_sock_release(struct udp_tunnel_sock *uts)
>> +{
>> + struct sock *sk = uts->sock->sk;
>> +
>> + rcu_assign_sk_user_data(uts->sock->sk, NULL);
>> + kernel_sock_shutdown(uts->sock, SHUT_RDWR);
>> + sk_release_kernel(sk);
>> +}
>> +EXPORT_SYMBOL_GPL(udp_tunnel_sock_release);
>> +
>> +void udp_tunnel_sock_free(struct udp_tunnel_sock *uts)
>> +{
>> + kfree(uts);
>> +}
>> +EXPORT_SYMBOL_GPL(udp_tunnel_sock_free);
>> +
>> MODULE_LICENSE("GPL");
>> diff --git a/net/ipv6/Makefile b/net/ipv6/Makefile
>> index 2fe6836..45f830e 100644
>> --- a/net/ipv6/Makefile
>> +++ b/net/ipv6/Makefile
>
> Probably good to make IPv4 and v6 stuff in separate patches.
Is this really necessary? Removing dependency may be tricky..
>
>> @@ -35,6 +35,7 @@ obj-$(CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION) += xfrm6_mode_ro.o
>> obj-$(CONFIG_INET6_XFRM_MODE_BEET) += xfrm6_mode_beet.o
>> obj-$(CONFIG_IPV6_MIP6) += mip6.o
>> obj-$(CONFIG_NETFILTER) += netfilter/
>> +obj-$(CONFIG_NET_UDP_TUNNEL) += ip6_udp_tunnel.o
>>
>> obj-$(CONFIG_IPV6_VTI) += ip6_vti.o
>> obj-$(CONFIG_IPV6_SIT) += sit.o
>> diff --git a/net/ipv6/ip6_udp_tunnel.c b/net/ipv6/ip6_udp_tunnel.c
>> new file mode 100644
>> index 0000000..5109f46
>> --- /dev/null
>> +++ b/net/ipv6/ip6_udp_tunnel.c
>> @@ -0,0 +1,121 @@
>> +#include <linux/module.h>
>> +#include <linux/errno.h>
>> +#include <linux/socket.h>
>> +#include <linux/udp.h>
>> +#include <linux/types.h>
>> +#include <linux/kernel.h>
>> +#include <linux/in6.h>
>> +#include <net/udp.h>
>> +#include <net/udp_tunnel.h>
>> +#include <net/net_namespace.h>
>> +#include <net/netns/generic.h>
>> +#include <net/ip6_tunnel.h>
>> +#include <net/ip6_checksum.h>
>> +
>> +int udp_sock_create6(struct net *net, struct udp_port_cfg *cfg,
>> + struct socket **sockp)
>> +{
>> + struct sockaddr_in6 udp6_addr;
>> + int err = -EINVAL;
>> + struct socket *sock = NULL;
>> +
>> + err = sock_create_kern(AF_INET6, SOCK_DGRAM, 0, &sock);
>> + if (err < 0)
>> + goto error;
>> +
>> + sk_change_net(sock->sk, net);
>> +
>> + udp6_addr.sin6_family = AF_INET6;
>> + memcpy(&udp6_addr.sin6_addr, &cfg->local_ip6,
>> + sizeof(udp6_addr.sin6_addr));
>> + udp6_addr.sin6_port = cfg->local_udp_port;
>> + err = kernel_bind(sock, (struct sockaddr *)&udp6_addr,
>> + sizeof(udp6_addr));
>> + if (err < 0)
>> + goto error;
>> +
>> + if (cfg->peer_udp_port) {
>> + udp6_addr.sin6_family = AF_INET6;
>> + memcpy(&udp6_addr.sin6_addr, &cfg->peer_ip6,
>> + sizeof(udp6_addr.sin6_addr));
>> + udp6_addr.sin6_port = cfg->peer_udp_port;
>> + err = kernel_connect(sock,
>> + (struct sockaddr *)&udp6_addr,
>> + sizeof(udp6_addr), 0);
>> + }
>> + if (err < 0)
>> + goto error;
>> +
>> + udp_set_no_check6_tx(sock->sk, !cfg->use_udp6_tx_checksums);
>> + udp_set_no_check6_rx(sock->sk, !cfg->use_udp6_rx_checksums);
>> +
>> + *sockp = sock;
>> + return 0;
>> +
>> +error:
>> + if (sock) {
>> + kernel_sock_shutdown(sock, SHUT_RDWR);
>> + sk_release_kernel(sock->sk);
>> + }
>> + *sockp = NULL;
>> + return err;
>> +}
>> +EXPORT_SYMBOL_GPL(udp_sock_create6);
>> +
>> +int udp_tunnel6_xmit_skb(struct udp_tunnel_sock *uts, struct dst_entry *dst,
>> + struct sk_buff *skb, struct net_device *dev,
>> + struct in6_addr *saddr, struct in6_addr *daddr,
>> + __u8 prio, __u8 ttl, __be16 src_port, __be16 dst_port)
>> +{
>> + struct udphdr *uh;
>> + struct ipv6hdr *ip6h;
>> +
>> + __skb_push(skb, sizeof(*uh));
>> + skb_reset_transport_header(skb);
>> + uh = udp_hdr(skb);
>> +
>> + uh->dest = dst_port;
>> + uh->source = src_port;
>> +
>> + uh->len = htons(skb->len);
>> + uh->check = 0;
>> +
>> + memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
>> + IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED
>> + | IPSKB_REROUTED);
>> + skb_dst_set(skb, dst);
>> +
>> + if (!skb_is_gso(skb) && !(dst->dev->features & NETIF_F_IPV6_CSUM)) {
>> + __wsum csum = skb_checksum(skb, 0, skb->len, 0);
>> +
>> + skb->ip_summed = CHECKSUM_UNNECESSARY;
>> + uh->check = csum_ipv6_magic(saddr, daddr, skb->len,
>> + IPPROTO_UDP, csum);
>> + if (uh->check == 0)
>> + uh->check = CSUM_MANGLED_0;
>> + } else {
>> + skb->ip_summed = CHECKSUM_PARTIAL;
>> + skb->csum_start = skb_transport_header(skb) - skb->head;
>> + skb->csum_offset = offsetof(struct udphdr, check);
>> + uh->check = ~csum_ipv6_magic(saddr, daddr,
>> + skb->len, IPPROTO_UDP, 0);
>> + }
>
> Can't we call udp6_set_csum for this?
Thanks for pointing it out. Will do.
>
>> +
>> + __skb_push(skb, sizeof(*ip6h));
>> + skb_reset_network_header(skb);
>> + ip6h = ipv6_hdr(skb);
>> + ip6h->version = 6;
>> + ip6h->priority = prio;
>> + ip6h->flow_lbl[0] = 0;
>> + ip6h->flow_lbl[1] = 0;
>> + ip6h->flow_lbl[2] = 0;
>> + ip6h->payload_len = htons(skb->len);
>> + ip6h->nexthdr = IPPROTO_UDP;
>> + ip6h->hop_limit = ttl;
>> + ip6h->daddr = *daddr;
>> + ip6h->saddr = *saddr;
>> +
>> + ip6tunnel_xmit(skb, dev);
>
> So iptunnel_xmit creates the IP header, but ip6tunnel_xmit doesn't. It
> should be on the TODO list to make this consistent!
Agreed.
>
>> + return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(udp_tunnel6_xmit_skb);
>> --
>> 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
^ permalink raw reply
* Re: [Patch v3 net-next 09/12] net: fec: change FEC alignment according to i.mx6 sx requirement
From: David Miller @ 2014-09-12 20:40 UTC (permalink / raw)
To: Frank.Li
Cc: b38611, netdev, lznuaa, shawn.guo, linux-arm-kernel, devicetree,
linux
In-Reply-To: <1410373845-5801-10-git-send-email-Frank.Li@freescale.com>
From: Frank Li <Frank.Li@freescale.com>
Date: Thu, 11 Sep 2014 02:30:42 +0800
> +
> + unsigned tx_align;
> + unsigned rx_align;
> };
Please always fully write out "unsigned int" rather than just "unsigned".
> @@ -2399,6 +2393,7 @@ fec_enet_alloc_rxq_buffers(struct net_device *ndev, unsigned int queue)
> struct sk_buff *skb;
> struct bufdesc *bdp;
> struct fec_enet_priv_rx_q *rxq;
> + unsigned off;
Likewise.
^ permalink raw reply
* Re: [Patch net-next v2 0/8] ipv6: clean up locking code in anycast and mcast
From: Hannes Frederic Sowa @ 2014-09-12 20:40 UTC (permalink / raw)
To: Cong Wang; +Cc: netdev, Hideaki YOSHIFUJI, David S. Miller
In-Reply-To: <1410474916-21873-1-git-send-email-xiyou.wangcong@gmail.com>
On Do, 2014-09-11 at 15:35 -0700, Cong Wang wrote:
> This patchset cleans up the locking code in anycast.c and mcast.c
> and makes the refcount code more readable.
>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
>
> v1 -> v2:
> * refactor some code and make it in a separated patch
> * update comments
>
> Cong Wang (8):
> ipv6: drop useless rcu_read_lock() in anycast
> ipv6: remove ipv6_sk_ac_lock
> ipv6: clean up ipv6_dev_ac_inc()
> ipv6: refactor __ipv6_dev_ac_inc()
> ipv6: drop ipv6_sk_mc_lock in mcast
> ipv6: drop some rcu_read_lock in mcast
> ipv6: update the comment in mcast.c
> ipv6: refactor ipv6_dev_mc_inc()
All reviewed, looks good, thanks for following up on this!
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
^ permalink raw reply
* Re: [PATCH net-next] Revert "ipv4: Clarify in docs that accept_local requires rp_filter."
From: David Miller @ 2014-09-12 20:34 UTC (permalink / raw)
To: sebastien.barre
Cc: ja, netdev, gregory.detal, christoph.paasch, hannes,
sergei.shtylyov
In-Reply-To: <1410366023-9129-1-git-send-email-sebastien.barre@uclouvain.be>
From: Sébastien Barré <sebastien.barre@uclouvain.be>
Date: Wed, 10 Sep 2014 18:20:23 +0200
> This reverts commit c801e3cc1925 ("ipv4: Clarify in docs that accept_local requires rp_filter.").
> It is not needed anymore since commit 1dced6a85482 ("ipv4: Restore accept_local behaviour in fib_validate_source()").
>
> Suggested-by: Julian Anastasov <ja@ssi.bg>
> Cc: Gregory Detal <gregory.detal@uclouvain.be>
> Cc: Christoph Paasch <christoph.paasch@uclouvain.be>
> Cc: Hannes Frederic Sowa <hannes@redhat.com>
> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> Signed-off-by: Sébastien Barré <sebastien.barre@uclouvain.be>
Applied, thanks.
^ permalink raw reply
* [PATCH 1/2] bridge: Check if vlan filtering is enabled only once.
From: Vladislav Yasevich @ 2014-09-12 20:26 UTC (permalink / raw)
To: netdev; +Cc: shemminger, Toshiaki Makita, Vladislav Yasevich
In-Reply-To: <1410553577-17519-1-git-send-email-vyasevic@redhat.com>
The bridge code checks if vlan filtering is enabled on both
ingress and egress. When the state flip happens, it
is possible for the bridge to currently be forwarding packets
and forwarding behavior becomes non-deterministic. Bridge
may drop packets on some interfaces, but not others.
This patch solves this by caching the filtered state of the
packet into skb_cb on ingress. The skb_cb is guaranteed to
not be over-written between the time packet entres bridge
forwarding path and the time it leaves it. On egress, we
can then check the cached state to see if we need to
apply filtering information.
Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
---
Please consider for stable.
net/bridge/br_private.h | 3 +++
net/bridge/br_vlan.c | 14 ++++++++++----
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 62a7fa2..b6c04cb 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -309,6 +309,9 @@ struct br_input_skb_cb {
int igmp;
int mrouters_only;
#endif
+#ifdef CONFIG_BRIDGE_VLAN_FILTERING
+ bool vlan_filtered;
+#endif
};
#define BR_INPUT_SKB_CB(__skb) ((struct br_input_skb_cb *)(__skb)->cb)
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index e1bcd65..f645197 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -125,7 +125,8 @@ struct sk_buff *br_handle_vlan(struct net_bridge *br,
{
u16 vid;
- if (!br->vlan_enabled)
+ /* If this packet was not filtered at input, let it pass */
+ if (!BR_INPUT_SKB_CB(skb)->vlan_filtered)
goto out;
/* Vlan filter table must be configured at this point. The
@@ -164,8 +165,10 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
/* If VLAN filtering is disabled on the bridge, all packets are
* permitted.
*/
- if (!br->vlan_enabled)
+ if (!br->vlan_enabled) {
+ BR_INPUT_SKB_CB(skb)->vlan_filtered = false;
return true;
+ }
/* If there are no vlan in the permitted list, all packets are
* rejected.
@@ -173,6 +176,7 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
if (!v)
goto drop;
+ BR_INPUT_SKB_CB(skb)->vlan_filtered = true;
proto = br->vlan_proto;
/* If vlan tx offload is disabled on bridge device and frame was
@@ -251,7 +255,8 @@ bool br_allowed_egress(struct net_bridge *br,
{
u16 vid;
- if (!br->vlan_enabled)
+ /* If this packet was not filtered at input, let it pass */
+ if (!BR_INPUT_SKB_CB(skb)->vlan_filtered)
return true;
if (!v)
@@ -270,7 +275,8 @@ bool br_should_learn(struct net_bridge_port *p, struct sk_buff *skb, u16 *vid)
struct net_bridge *br = p->br;
struct net_port_vlans *v;
- if (!br->vlan_enabled)
+ /* If filtering was disabled at input, let it pass. */
+ if (!BR_INPUT_SKB_CB(skb)->vlan_filtered)
return true;
v = rcu_dereference(p->vlan_info);
--
1.9.3
^ permalink raw reply related
* [PATCH 2/2] bridge: Allow clearing of pvid and untagged bitmap
From: Vladislav Yasevich @ 2014-09-12 20:26 UTC (permalink / raw)
To: netdev; +Cc: shemminger, Toshiaki Makita, Vlad Yasevich
In-Reply-To: <1410553577-17519-1-git-send-email-vyasevic@redhat.com>
From: Vlad Yasevich <vyasevic@redhat.com>
Currently, it is possible to modify the vlan filter
configuration to add pvid or untagged support.
For example:
bridge vlan add vid 10 dev eth0
bridge vlan add vid 10 dev eth0 untagged pvid
The second statement will modify vlan 10 to
include untagged and pvid configuration.
However, it is currently impossible to go backwards
bridge vlan add vid 10 dev eth0 untagged pvid
bridge vlan add vid 10 dev eth0
Here nothing happens. This patch correct this so
that any modifiers not supplied are removed from
the configuration.
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
---
net/bridge/br_vlan.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index f645197..4b86738 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -27,9 +27,13 @@ static void __vlan_add_flags(struct net_port_vlans *v, u16 vid, u16 flags)
{
if (flags & BRIDGE_VLAN_INFO_PVID)
__vlan_add_pvid(v, vid);
+ else
+ __vlan_delete_pvid(v, vid);
if (flags & BRIDGE_VLAN_INFO_UNTAGGED)
set_bit(vid, v->untagged_bitmap);
+ else
+ clear_bit(vid, v->untagged_bitmap);
}
static int __vlan_add(struct net_port_vlans *v, u16 vid, u16 flags)
--
1.9.3
^ permalink raw reply related
* [PATCH 0/2] bridge: Two small fixes to vlan filtering code.
From: Vladislav Yasevich @ 2014-09-12 20:26 UTC (permalink / raw)
To: netdev; +Cc: shemminger, Toshiaki Makita, Vladislav Yasevich
This series corrects 2 small issues that I've ran across recently
while doing more work with vlan filtering changes.
Thanks
-vlad
Vlad Yasevich (1):
bridge: Check if vlan filtering is enabled only once.
bridge: Allow clearing of pvid and untagged bitmap
net/bridge/br_private.h | 3 +++
net/bridge/br_vlan.c | 18 ++++++++++++++----
2 files changed, 17 insertions(+), 4 deletions(-)
--
1.9.3
^ permalink raw reply
* Re: [Patch net-next] ipv6: exit early in addrconf_notify() if IPv6 is disabled
From: Hannes Frederic Sowa @ 2014-09-12 20:18 UTC (permalink / raw)
To: Cong Wang; +Cc: netdev, Hideaki YOSHIFUJI, David S. Miller
In-Reply-To: <1410473236-3346-1-git-send-email-xiyou.wangcong@gmail.com>
Hi Cong,
On Do, 2014-09-11 at 15:07 -0700, Cong Wang wrote:
> If IPv6 is explicitly disabled before the interface comes up,
> it makes no sense to continue when it comes up, even just
> print a message.
>
> (I am not sure about other cases though, so I prefer not to touch)
>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
I checked the other notifier_blocks, I don't think we need to change
anything there.
disable_ipv6 is absolutely bad implemented. It should not be in the ipv6
procfs namespace at all. An inet6_dev must be available to manage this
knob! Thus we are automagically subscribed to all ipv6 LL multicast
groups.
I don't see any problems with this patch:
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Thanks,
Hannes
^ permalink raw reply
* Re: [RFC v2 3/6] kthread: warn on kill signal if not OOM
From: Luis R. Rodriguez @ 2014-09-12 20:14 UTC (permalink / raw)
To: Tejun Heo, Tom Gundersen
Cc: Lennart Poettering, Kay Sievers, Dmitry Torokhov,
Greg Kroah-Hartman, Wu Zhangjin, Takashi Iwai, Arjan van de Ven,
linux-kernel@vger.kernel.org, Oleg Nesterov, hare, Andrew Morton,
Tetsuo Handa, Joseph Salisbury, Benjamin Poirier,
Santosh Rastapur, One Thousand Gnomes, Tim Gardner,
Pierre Fersing, Nagalakshmi Nandigama, Praveen Krishnamoorthy,
Sreekan
In-Reply-To: <20140909230333.GD3154@mtj.dyndns.org>
On Tue, Sep 9, 2014 at 4:03 PM, Tejun Heo <tj@kernel.org> wrote:
> On Tue, Sep 09, 2014 at 12:25:29PM +0900, Tejun Heo wrote:
>> Hello,
>>
>> On Mon, Sep 08, 2014 at 08:19:12PM -0700, Luis R. Rodriguez wrote:
>> > On the systemd side of things it should enable this sysctl and for
>> > older kernels what should it do?
>>
>> Supposing the change is backported via -stable, it can try to set the
>> sysctl on all kernels. If the knob doesn't exist, the fix is not
>> there and nothing can be done about it.
>
> The more I think about it, the more I think this should be a
> per-insmod instance thing rather than a system-wide switch.
Agreed, a good use case that comes to mind would be systemd's
modules-load.d lists used by systemd services to require modules, the
hooks there however likely expect probe to complete as part of the
service, since the timeout is not applicable to these the synchronous
probe for them would be good while systemd would use async probe for
regular modules.
> Currently
> the kernel param code doesn't allow a generic param outside the ones
> specified by the module itself but adding support for something like
> driver.async_load=1 shouldn't be too difficult, applying that to
> existing systems shouldn't be much more difficult than a system-wide
> switch, and it'd be siginificantly cleaner than fiddling with driver
> blacklist.
Agreed.
Luis
^ permalink raw reply
* Re: [PATCH net-next v2] net: filter: constify detection of pkt_type_offset
From: David Miller @ 2014-09-12 20:13 UTC (permalink / raw)
To: cwang
Cc: hannes, alexei.starovoitov, netdev, eric.dumazet, markos.chandras,
schwidefsky, dborkman, kda
In-Reply-To: <CAHA+R7N9voYjoWGyOvfR35mNc3bK_ZMO8X9OAp6Cy7uZr3E-Fw@mail.gmail.com>
From: Cong Wang <cwang@twopensource.com>
Date: Fri, 12 Sep 2014 10:47:54 -0700
> Don't worry, it is not a big deal at all, unless DaveM gets confused too.
DaveM is always confused.
^ permalink raw reply
* Re: [RFC v2 3/6] kthread: warn on kill signal if not OOM
From: Luis R. Rodriguez @ 2014-09-12 20:09 UTC (permalink / raw)
To: Tom Gundersen, Tejun Heo
Cc: One Thousand Gnomes, Takashi Iwai, Kay Sievers, Sreekanth Reddy,
James Bottomley, Praveen Krishnamoorthy, hare,
Nagalakshmi Nandigama, Wu Zhangjin, Tetsuo Handa,
mpt-fusionlinux.pdl, Tim Gardner, Benjamin Poirier,
Santosh Rastapur, Casey Leedom, Hariprasad S, Pierre Fersing,
Arjan van de Ven, Abhijit Mahajan, systemd Mailing List
In-Reply-To: <CAG-2HqWYXo+uRtOk_XW-Bi5aXcTLphEMLCMy8a2THuEg9dHPzw@mail.gmail.com>
On Thu, Sep 11, 2014 at 10:48 PM, Tom Gundersen <teg@jklm.no> wrote:
> On Fri, Sep 12, 2014 at 12:26 AM, Luis R. Rodriguez
> <mcgrof@do-not-panic.com> wrote:
>> On Thu, Sep 11, 2014 at 2:43 PM, Tom Gundersen <teg@jklm.no> wrote:
>>> How about simply introducing a new flag to finit_module() to indicate
>>> that the caller does not care about asynchronicity. We could then pass
>>> this from udev, but existing scripts calling modprobe/insmod will not
>>> be affected.
>>
>> Do you mean that you *do want asynchronicity*?
>
> Precisely, udev would opt-in, but existing scripts etc would not.
Sure that's the other alternative that Tejun was mentioning.
>>> But isn't finit_module() taking a long time a serious problem given
>>> that it means no other module can be loaded in parallel?
>>
>> Indeed but having a desire to make the init() complete fast is
>> different than the desire to have the combination of both init and
>> probe fast synchronously.
>
> I guess no one is arguing that probe should somehow be required to be
> fast, but rather:
>
>> If userspace wants init to be fast and let
>> probe be async then userspace has no option but to deal with the fact
>> that async probe will be async, and it should then use other methods
>> to match any dependencies if its doing that itself.
>
> Correct. And this therefore likely needs to be opt-in behaviour per
> finit_module() invocation to avoid breaking old assumptions.
Sure.
>> For example
>> networking should not kick off after a network driver is loaded but
>> rather one the device creeps up on udev. We should be good with
>> networking dealing with this correctly today but not sure about other
>> subsystems. depmod should be able to load the required modules in
>> order and if bus drivers work right then probe of the remnant devices
>> should happen asynchronously. The one case I can think of that is a
>> bit different is modules-load.d things but those *do not rely on the
>> timeout*, but are loaded prior to a service requirement. Note though
>> that if those modules had probe and they then run async'd then systemd
>> service would probably need to consider that the requirements may not
>> be there until later. If this is not carefully considered that could
>> introduce regression to users of modules-load.d when async probe is
>> fully deployed. The same applies to systemd making assumptions of kmod
>> loading a module and a dependency being complete as probe would have
>> run it before.
>
> Yeah, these all needs to be considered when deciding whether or not to
> enable async in each specific case.
Yes and come to think of it I'd recommend opting out of async
functionality for modules-load.d given that it does *not* hooked with
the timeout and there is a good chances its users likely do want to
wait for probe to run at this point.
Given this I also am inclined now for the per module request to be
async or not (default) from userspace. The above would be a good
example starting use case.
>> I believe one concern here lies in on whether or not userspace
>> is properly equipped to deal with the requirements on module loading
>> doing async probing and that possibly failing. Perhaps systemd might
>> think all userspace is ready for that but are we sure that's the case?
>
> There almost certainly are custom things out there relying on the
> synchronous behaviour, but if we make it opt-in we should not have a
> problem.
Indeed.
BTW as for the cxgb4 device driver it fails to load because it relies
on get_vpd_params() on probe, that end sup calling
pci_vpd_pci22_wait() which will fail if if
fatal_signal_pending(current). This is an example now completely
unrelated to the OOM series, and any other uses of
fatal_signal_pending(current) should trigger similar failures on
device drivers.
Luis
^ permalink raw reply
* [PATCH v2] net: rfkill: gpio: Enable module auto-loading for ACPI based switches
From: Marcel Holtmann @ 2014-09-12 19:49 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, netdev
For the ACPI based switches the MODULE_DEVICE_TABLE is missing to
export the entries for module auto-loading.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
net/rfkill/rfkill-gpio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index 02a86a27fd84..5fa54dd78e25 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -163,6 +163,7 @@ static const struct acpi_device_id rfkill_acpi_match[] = {
{ "LNV4752", RFKILL_TYPE_GPS },
{ },
};
+MODULE_DEVICE_TABLE(acpi, rfkill_acpi_match);
#endif
static struct platform_driver rfkill_gpio_driver = {
--
1.9.3
^ permalink raw reply related
* Re: [PATCH] net: rfkill: gpio: Enable module auto-loading for ACPI based switches
From: Marcel Holtmann @ 2014-09-12 19:46 UTC (permalink / raw)
To: Johannes Berg; +Cc: netdev
In-Reply-To: <1410547842-50207-1-git-send-email-marcel@holtmann.org>
Hi Johannes,
> The switches that are enumerated over ACPI require a MODULE_ALIAS to
> allow auto-loading of the module.
>
> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> ---
> net/rfkill/rfkill-gpio.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
> index 02a86a27fd84..35e659392209 100644
> --- a/net/rfkill/rfkill-gpio.c
> +++ b/net/rfkill/rfkill-gpio.c
> @@ -180,3 +180,12 @@ module_platform_driver(rfkill_gpio_driver);
> MODULE_DESCRIPTION("gpio rfkill");
> MODULE_AUTHOR("NVIDIA");
> MODULE_LICENSE("GPL");
> +
> +#ifdef CONFIG_ACPI
> +MODULE_ALIAS("acpi:BCM2E1A");
> +MODULE_ALIAS("acpi:BCM2E39");
> +MODULE_ALIAS("acpi:BCM2E3D");
> +MODULE_ALIAS("acpi:BCM2E64");
> +MODULE_ALIAS("acpi:BCM4752");
> +MODULE_ALIAS("acpi:LNV4752");
> +#endif
while this patch gets the job done, it is too complicated. We can just use MODULE_DEVICE_TABLE for it. I will send an updated version.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH v2 net] ipv6: clean up anycast when an interface is destroyed
From: Hannes Frederic Sowa @ 2014-09-12 19:45 UTC (permalink / raw)
To: Sabrina Dubroca; +Cc: David Miller, cwang, netdev
In-Reply-To: <20140910212302.GA26184@kria>
On Mi, 2014-09-10 at 23:23 +0200, Sabrina Dubroca wrote:
> If we try to rmmod the driver for an interface while sockets with
> setsockopt(JOIN_ANYCAST) are alive, some refcounts aren't cleaned up
> and we get stuck on:
>
> unregister_netdevice: waiting for ens3 to become free. Usage count = 1
>
> If we LEAVE_ANYCAST/close everything before rmmod'ing, there is no
> problem.
>
> We need to perform a cleanup similar to the one for multicast in
> addrconf_ifdown(how == 1).
>
> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
This is the correct fix for the bug:
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
more comments inline:
> ---
> v2: remove comment
>
> include/net/addrconf.h | 1 +
> net/ipv6/addrconf.c | 8 +++++---
> net/ipv6/anycast.c | 21 +++++++++++++++++++++
> 3 files changed, 27 insertions(+), 3 deletions(-)
>
> diff --git a/include/net/addrconf.h b/include/net/addrconf.h
> index f679877bb601..ec51e673b4b6 100644
> --- a/include/net/addrconf.h
> +++ b/include/net/addrconf.h
> @@ -204,6 +204,7 @@ void ipv6_sock_ac_close(struct sock *sk);
>
> int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr);
> int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr);
> +void ipv6_ac_destroy_dev(struct inet6_dev *idev);
> bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
> const struct in6_addr *addr);
> bool ipv6_chk_acast_addr_src(struct net *net, struct net_device *dev,
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index fc1fac2a0528..3342ee64f2e3 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -3094,11 +3094,13 @@ static int addrconf_ifdown(struct net_device *dev, int how)
>
> write_unlock_bh(&idev->lock);
>
> - /* Step 5: Discard multicast list */
> - if (how)
> + /* Step 5: Discard anycast and multicast list */
> + if (how) {
> + ipv6_ac_destroy_dev(idev);
> ipv6_mc_destroy_dev(idev);
> - else
> + } else {
> ipv6_mc_down(idev);
> + }
Do we also need to provide a ipv6_ac_down function to unload all anycast
sources when we ifdown an interface (we need to keep the entries in
aca_list around and activate them when we initialize the interface
again)?
Thanks,
Hannes
^ permalink raw reply
* Re: [PATCH net 1/2] r8169: fix the default setting of rx vlan
From: Francois Romieu @ 2014-09-12 19:40 UTC (permalink / raw)
To: Hayes Wang; +Cc: netdev, nic_swsd, linux-kernel
In-Reply-To: <1394712342-15778-39-Taiwan-albertk@realtek.com>
Hayes Wang <hayeswang@realtek.com> :
> If the parameter "features" of __rtl8169_set_features() is equal to
> dev->features, the variable "changed" is alwayes 0, and nothing would
> be changed.
[...]
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 91652e7..f3ce284 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -6707,7 +6707,12 @@ static int rtl_open(struct net_device *dev)
>
> rtl8169_init_phy(dev, tp);
>
> - __rtl8169_set_features(dev, dev->features);
> + if (dev->features & NETIF_F_HW_VLAN_CTAG_RX)
> + tp->cp_cmd |= RxVlan;
> + else
> + tp->cp_cmd &= ~RxVlan;
> +
> + RTL_W16(CPlusCmd, tp->cp_cmd);
Damn good catch.
The same fix should be relevant for NETIF_F_RXCSUM. You may thus as
well remove the "changed" test in __rtl8169_set_features and keep
everything there.
The commit message could notify the driver don't behave as expected since
6bbe021d405fff46b64a08dca51b06897b897a67 ("r8169: Support RX-ALL flag.")
to ease stable people's work.
--
Ueimor
^ permalink raw reply
* Re: [PATCH] IB/ipoib: order:1 failure in ipoib_cm_alloc_rx_skb causes softlockup
From: David Miller @ 2014-09-12 19:20 UTC (permalink / raw)
To: venkat.x.venkatsubra; +Cc: netdev
In-Reply-To: <1410538533-11029-1-git-send-email-venkat.x.venkatsubra@oracle.com>
From: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
Date: Fri, 12 Sep 2014 09:15:33 -0700
> @@ -61,6 +61,11 @@ enum ipoib_flush_level {
> IPOIB_FLUSH_HEAVY
> };
>
> +#ifdef max
> +#undef max
> +#endif
> +#define max(x, y) (((int)(x) > (int)(y)) ? x : y)
> +
> enum {
> IPOIB_ENCAP_LEN = 4,
>
This is insanely inappropriate.
Use the linux/kernel.h provided max() definition, there is no reason
to redefine your own version, ever.
^ permalink raw reply
* [PATCH] net: rfkill: gpio: Enable module auto-loading for ACPI based switches
From: Marcel Holtmann @ 2014-09-12 18:50 UTC (permalink / raw)
To: Johannes Berg; +Cc: netdev
The switches that are enumerated over ACPI require a MODULE_ALIAS to
allow auto-loading of the module.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
net/rfkill/rfkill-gpio.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index 02a86a27fd84..35e659392209 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -180,3 +180,12 @@ module_platform_driver(rfkill_gpio_driver);
MODULE_DESCRIPTION("gpio rfkill");
MODULE_AUTHOR("NVIDIA");
MODULE_LICENSE("GPL");
+
+#ifdef CONFIG_ACPI
+MODULE_ALIAS("acpi:BCM2E1A");
+MODULE_ALIAS("acpi:BCM2E39");
+MODULE_ALIAS("acpi:BCM2E3D");
+MODULE_ALIAS("acpi:BCM2E64");
+MODULE_ALIAS("acpi:BCM4752");
+MODULE_ALIAS("acpi:LNV4752");
+#endif
--
1.9.3
^ permalink raw reply related
* connect returns EADDRNOTAVAIL on ~600k+ sockets host
From: Denys Fedoryshchenko @ 2014-09-12 18:18 UTC (permalink / raw)
To: netdev
Hi
I noticed strange behaviour on loaded server (haproxy), while it is
handling load for https traffic well, tcp monitoring started to give
false alerts. And here what i found:
HTTPS-BALANCER ~ # telnet 127.0.0.1 23
telnet: can't connect to remote host (127.0.0.1): Cannot assign
requested address
HTTPS-BALANCER ~ # nc -v 127.0.0.1 23
127.0.0.1 (127.0.0.1:23) open
��\x01��\x1f��\x01��\x03
HTTPS-BALANCER login: ^Cpunt!
The difference is (relevant lines from strace):
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(3, {sa_family=AF_INET, sin_port=htons(0),
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
rt_sigaction(SIGALRM, {0x41ecfb, [ALRM], SA_RESTORER|SA_RESTART,
0x7f80725bf5b0}, {SIG_DFL, [], 0}, 8) = 0
alarm(0) = 0
connect(3, {sa_family=AF_INET, sin_port=htons(23),
sin_addr=inet_addr("127.0.0.1")}, 16) = 0
rt_sigaction(SIGALRM, {SIG_IGN, [ALRM], SA_RESTORER|SA_RESTART,
0x7f80725bf5b0}, {0x41ecfb, [ALRM], SA_RESTORER|SA_RESTART, 0x7
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
connect(3, {sa_family=AF_INET, sin_port=htons(23),
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EADDRNOTAVAIL (Cannot assign
requested address)
write(2, "telnet: can't connect to remote host (127.0.0.1): Cannot
assign requested address\n", 82telnet: can't connect to remote host
(127.0.0.1): Cannot assign requested address
So,
bind(3, {sa_family=AF_INET, sin_port=htons(0),
sin_addr=inet_addr("0.0.0.0")}, 16) = 0
is fixing issue, but is it really supposed to be like this?
Just for information host load and some network stats:
from /proc/net/protocols, i removed irrelevant zero values entries
protocol size sockets memory press maxhdr slab module cl co di ac
io in de sh ss gs se re sp bi br ha uh gp em
UDP 816 1 0 NI 0 yes kernel y y y n
y n y n y y y y y n y y y y n
TCP 1640 728255 751777 no 208 yes kernel y y y y
y y y y y y y y y n y y y y y
sockets: used 674375
TCP: inuse 727092 orphan 55119 tw 138533 alloc 729419 mem 745187
UDP: inuse 1 mem 0
UDPLITE: inuse 0
RAW: inuse 0
FRAG: inuse 0 memory 0
0.0.0.0 sockets:
tcp 0 0 0.0.0.0:65530 0.0.0.0:*
LISTEN
tcp 0 0 0.0.0.0:443 0.0.0.0:*
LISTEN
tcp 0 0 0.0.0.0:8880 0.0.0.0:*
LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:*
LISTEN
tcp 0 0 0.0.0.0:23 0.0.0.0:*
LISTEN
udp 0 0 0.0.0.0:53073 0.0.0.0:*
127.0.0.1 sockets (this is watchdog, but if i disable, it wont change
anything)
tcp 0 0 127.0.0.1:65530 127.0.0.1:55649
TIME_WAIT
tcp 0 0 127.0.0.1:65530 127.0.0.1:41762
FIN_WAIT2
tcp 0 0 127.0.0.1:65530 127.0.0.1:36863
TIME_WAIT
tcp 0 0 127.0.0.1:65530 127.0.0.1:34533
TIME_WAIT
tcp 0 0 127.0.0.1:65530 127.0.0.1:35262
TIME_WAIT
tcp 0 0 127.0.0.1:65530 127.0.0.1:45872
TIME_WAIT
^ permalink raw reply
* Re: [net-next PATCH v5 12/16] net: sched: rcu'ify cls_bpf
From: Eric Dumazet @ 2014-09-12 18:22 UTC (permalink / raw)
To: John Fastabend; +Cc: xiyou.wangcong, davem, jhs, netdev, paulmck, brouer
In-Reply-To: <20140912163337.19588.52022.stgit@nitbit.x32>
On Fri, 2014-09-12 at 09:33 -0700, John Fastabend wrote:
> This patch makes the cls_bpf classifier RCU safe. The tcf_lock
> was being used to protect a list of cls_bpf_prog now this list
> is RCU safe and updates occur with rcu_replace.
>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ---
Acked-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply
* Re: [net-next PATCH v5 11/16] net: sched: rcu'ify cls_rsvp
From: Eric Dumazet @ 2014-09-12 18:21 UTC (permalink / raw)
To: John Fastabend; +Cc: xiyou.wangcong, davem, jhs, netdev, paulmck, brouer
In-Reply-To: <20140912163312.19588.84899.stgit@nitbit.x32>
On Fri, 2014-09-12 at 09:33 -0700, John Fastabend wrote:
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ---
> net/sched/cls_rsvp.h | 160 ++++++++++++++++++++++++++++----------------------
> 1 file changed, 90 insertions(+), 70 deletions(-)
>
Acked-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply
* Re: [PATCH net-next v2] net: filter: constify detection of pkt_type_offset
From: Cong Wang @ 2014-09-12 17:47 UTC (permalink / raw)
To: Hannes Frederic Sowa
Cc: Alexei Starovoitov, netdev, Eric Dumazet, Markos Chandras,
Martin Schwidefsky, Daniel Borkmann, Denis Kirjanov
In-Reply-To: <1410542240.2970.5.camel@localhost>
On Fri, Sep 12, 2014 at 10:17 AM, Hannes Frederic Sowa
<hannes@stressinduktion.org> wrote:
> On Fr, 2014-09-12 at 10:12 -0700, Cong Wang wrote:
>> On Fri, Sep 12, 2014 at 10:09 AM, Hannes Frederic Sowa
>> <hannes@stressinduktion.org> wrote:
>> >
>> > Sure, he asked me to send it and I included his signed-off. I think I
>> > did that correctly?
>> >
>>
>> Maybe you should add v3 in case people like me get confused. :)
>
> Oh, sorry. I looked in patchworks for the next version number and missed
> the v2 submission. My bad, this should be submission v3. I think it is
> ok, since the other versions already went out of review state.
>
Don't worry, it is not a big deal at all, unless DaveM gets confused too.
^ permalink raw reply
* Re: [PATCH net-next v2] net: filter: constify detection of pkt_type_offset
From: Hannes Frederic Sowa @ 2014-09-12 17:17 UTC (permalink / raw)
To: Cong Wang
Cc: Alexei Starovoitov, netdev, Eric Dumazet, Markos Chandras,
Martin Schwidefsky, Daniel Borkmann, Denis Kirjanov
In-Reply-To: <CAHA+R7PrM3EwqD_7nT8odoCqmk7Q8cCdEcUn9Ck0MVPZKW3VXw@mail.gmail.com>
On Fr, 2014-09-12 at 10:12 -0700, Cong Wang wrote:
> On Fri, Sep 12, 2014 at 10:09 AM, Hannes Frederic Sowa
> <hannes@stressinduktion.org> wrote:
> >
> > Sure, he asked me to send it and I included his signed-off. I think I
> > did that correctly?
> >
>
> Maybe you should add v3 in case people like me get confused. :)
Oh, sorry. I looked in patchworks for the next version number and missed
the v2 submission. My bad, this should be submission v3. I think it is
ok, since the other versions already went out of review state.
Thanks for spotting,
Hannes
^ permalink raw reply
* Re: [PATCH net-next v2] net: filter: constify detection of pkt_type_offset
From: Cong Wang @ 2014-09-12 17:12 UTC (permalink / raw)
To: Hannes Frederic Sowa
Cc: Alexei Starovoitov, netdev, Eric Dumazet, Markos Chandras,
Martin Schwidefsky, Daniel Borkmann, Denis Kirjanov
In-Reply-To: <1410541788.2970.2.camel@localhost>
On Fri, Sep 12, 2014 at 10:09 AM, Hannes Frederic Sowa
<hannes@stressinduktion.org> wrote:
>
> Sure, he asked me to send it and I included his signed-off. I think I
> did that correctly?
>
Maybe you should add v3 in case people like me get confused. :)
^ 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