Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH v5] can: add Renesas R-Car CAN driver
From: Geert Uytterhoeven @ 2014-01-20 11:52 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: Sergei Shtylyov, netdev@vger.kernel.org, wg, linux-can,
	Linux-sh list, vksavl
In-Reply-To: <52DD0CC1.70205@pengutronix.de>

On Mon, Jan 20, 2014 at 12:47 PM, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> On 01/20/2014 12:43 PM, Geert Uytterhoeven wrote:
>> On Thu, Dec 26, 2013 at 10:37 PM, Sergei Shtylyov
>> <sergei.shtylyov@cogentembedded.com> wrote:
>>> Changes in version 3:
>>
>>> - added '__packed' to 'struct rcar_can_mbox_regs' and 'struct rcar_can_regs';
>>> - removed unneeded type cast in the probe() method.
>>
>>> +/* Mailbox registers structure */
>>> +struct rcar_can_mbox_regs {
>>> +       u32 id;         /* IDE and RTR bits, SID and EID */
>>> +       u8 stub;        /* Not used */
>>> +       u8 dlc;         /* Data Length Code - bits [0..3] */
>>> +       u8 data[8];     /* Data Bytes */
>>> +       u8 tsh;         /* Time Stamp Higher Byte */
>>> +       u8 tsl;         /* Time Stamp Lower Byte */
>>> +} __packed;
>>
>> Sorry, I missed the earlier discussion, but why the _packed?
>> One u32 and 12 bytes makes a nice multiple of 4.
>
> Better safe than sorry, it's the layout of the registers in hardware,
> don't let the compiler optimize here.

Actually __packed makes it less safe, as the compiler now assumes
the u32 id member is unaligned, and thus may turn 32-bit accesses into 4
byte accesses.

Fortunately it won't happen in this case as the code uses writel/readl to
acces the id member.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply

* Re: [PATCH v5] can: add Renesas R-Car CAN driver
From: Marc Kleine-Budde @ 2014-01-20 11:58 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Sergei Shtylyov, netdev@vger.kernel.org, wg, linux-can,
	Linux-sh list, vksavl
In-Reply-To: <CAMuHMdV5sMUnXb1Z1HeRk9+_dCGWrbD-DS62S7T4Be-77HvsvA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1925 bytes --]

On 01/20/2014 12:52 PM, Geert Uytterhoeven wrote:
> On Mon, Jan 20, 2014 at 12:47 PM, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
>> On 01/20/2014 12:43 PM, Geert Uytterhoeven wrote:
>>> On Thu, Dec 26, 2013 at 10:37 PM, Sergei Shtylyov
>>> <sergei.shtylyov@cogentembedded.com> wrote:
>>>> Changes in version 3:
>>>
>>>> - added '__packed' to 'struct rcar_can_mbox_regs' and 'struct rcar_can_regs';
>>>> - removed unneeded type cast in the probe() method.
>>>
>>>> +/* Mailbox registers structure */
>>>> +struct rcar_can_mbox_regs {
>>>> +       u32 id;         /* IDE and RTR bits, SID and EID */
>>>> +       u8 stub;        /* Not used */
>>>> +       u8 dlc;         /* Data Length Code - bits [0..3] */
>>>> +       u8 data[8];     /* Data Bytes */
>>>> +       u8 tsh;         /* Time Stamp Higher Byte */
>>>> +       u8 tsl;         /* Time Stamp Lower Byte */
>>>> +} __packed;
>>>
>>> Sorry, I missed the earlier discussion, but why the _packed?
>>> One u32 and 12 bytes makes a nice multiple of 4.
>>
>> Better safe than sorry, it's the layout of the registers in hardware,
>> don't let the compiler optimize here.
> 
> Actually __packed makes it less safe, as the compiler now assumes
> the u32 id member is unaligned, and thus may turn 32-bit accesses into 4
> byte accesses.
> 
> Fortunately it won't happen in this case as the code uses writel/readl to
> acces the id member.

Yes, as this are registers they must not be accessed directly. However
we can use "__attribute__ ((packed, aligned(4)))" to tell the compiler
that the base address of this struct is always aligned to 4 bytes.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]

^ permalink raw reply

* [PATCH net-next V5 0/3] net: Add GRO support for UDP encapsulating protocols
From: Or Gerlitz @ 2014-01-20 11:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, hkchu, edumazet, herbert, yanb, shlomop, therbert,
	Or Gerlitz

This series adds GRO handlers for protocols that do UDP encapsulation, with the
intent of being able to coalesce packets which encapsulate packets belonging to
the same TCP session.

For GRO purposes, the destination UDP port takes the role of the ether type
field in the ethernet header or the next protocol in the IP header.

The UDP GRO handler will only attempt to coalesce packets whose destination
port is registered to have gro handler.

The patches done against net-next 75e4364f67 "net: stmmac: fix NULL pointer 
dereference in stmmac_get_tx_hwtstamp"

Or.

v4 --> v5 changes:
  - followed Eric's directives to avoid using atomic get/put ops on the
    udp gro receive and complete callbacks and instead keep the rcu_read_lock
    when calling the next handler on the chain.

v3 --> v4 changes:

  - applied feedback from Tom on some micro-optimizations that save 
    branches and goto directives in the udp gro logic

 - applied feedback from Eric on correct RCU programming for the 
   add/remove flow of the upper protocols udp gro handlers


v2 --> v3 changes:

 - moved to use linked list to store the udp gro handlers, this solves the
   problem of consuming 512KB of memory for the handlers.

 - use a mark on the skb GRO CB data to disallow running the udp gro_receive twice
   on a packet, this solves the problem of udp encapsulated packets whose inner VM
   packet is udp and happen to carry a port which has registered offloads - and flush it.

 - invoke the udp offload protocol registration and de-registration from the vxlan driver
   in a sleepable context 


Or Gerlitz (3):
  net: Add GRO support for UDP encapsulating protocols
  net: Export gro_find_by_type helpers
  net: Add GRO support for vxlan traffic

 drivers/net/vxlan.c       |  117 ++++++++++++++++++++++++++++++++++--
 include/linux/netdevice.h |   10 +++-
 include/net/protocol.h    |    3 +
 include/net/vxlan.h       |    1 +
 net/core/dev.c            |    3 +
 net/ipv4/udp_offload.c    |  143 +++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 269 insertions(+), 8 deletions(-)

^ permalink raw reply

* [PATCH V5 net-next 2/3] net: Export gro_find_by_type helpers
From: Or Gerlitz @ 2014-01-20 11:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, hkchu, edumazet, herbert, yanb, shlomop, therbert,
	Or Gerlitz
In-Reply-To: <1390219161-9881-1-git-send-email-ogerlitz@mellanox.com>

Export the gro_find_receive/complete_by_type helpers to they can be invoked
by the gro callbacks of encapsulation protocols such as vxlan.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 net/core/dev.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 1578fd7..ed8af53 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3984,6 +3984,7 @@ struct packet_offload *gro_find_receive_by_type(__be16 type)
 	}
 	return NULL;
 }
+EXPORT_SYMBOL(gro_find_receive_by_type);
 
 struct packet_offload *gro_find_complete_by_type(__be16 type)
 {
@@ -3997,6 +3998,7 @@ struct packet_offload *gro_find_complete_by_type(__be16 type)
 	}
 	return NULL;
 }
+EXPORT_SYMBOL(gro_find_complete_by_type);
 
 static gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb)
 {
-- 
1.7.1

^ permalink raw reply related

* [PATCH V5 net-next 1/3] net: Add GRO support for UDP encapsulating protocols
From: Or Gerlitz @ 2014-01-20 11:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, hkchu, edumazet, herbert, yanb, shlomop, therbert,
	Or Gerlitz
In-Reply-To: <1390219161-9881-1-git-send-email-ogerlitz@mellanox.com>

Add GRO handlers for protocols that do UDP encapsulation, with the intent of
being able to coalesce packets which encapsulate packets belonging to
the same TCP session.

For GRO purposes, the destination UDP port takes the role of the ether type
field in the ethernet header or the next protocol in the IP header.

The UDP GRO handler will only attempt to coalesce packets whose destination
port is registered to have gro handler.

Use a mark on the skb GRO CB data to disallow (flush) running the udp gro receive
code twice on a packet. This solves the problem of udp encapsulated packets whose
inner VM packet is udp and happen to carry a port which has registered offloads.

Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 include/linux/netdevice.h |   10 +++-
 include/net/protocol.h    |    3 +
 net/core/dev.c            |    1 +
 net/ipv4/udp_offload.c    |  143 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 156 insertions(+), 1 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 83ce2ae..c310229 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1675,7 +1675,10 @@ struct napi_gro_cb {
 	unsigned long age;
 
 	/* Used in ipv6_gro_receive() */
-	int	proto;
+	u16	proto;
+
+	/* Used in udp_gro_receive */
+	u16	udp_mark;
 
 	/* used to support CHECKSUM_COMPLETE for tunneling protocols */
 	__wsum	csum;
@@ -1714,6 +1717,11 @@ struct packet_offload {
 	struct list_head	 list;
 };
 
+struct udp_offload {
+	__be16			 port;
+	struct offload_callbacks callbacks;
+};
+
 /* often modified stats are per cpu, other are shared (netdev->stats) */
 struct pcpu_sw_netstats {
 	u64     rx_packets;
diff --git a/include/net/protocol.h b/include/net/protocol.h
index 0e5f866..a7e986b 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -108,6 +108,9 @@ int inet_del_offload(const struct net_offload *prot, unsigned char num);
 void inet_register_protosw(struct inet_protosw *p);
 void inet_unregister_protosw(struct inet_protosw *p);
 
+int  udp_add_offload(struct udp_offload *prot);
+void udp_del_offload(struct udp_offload *prot);
+
 #if IS_ENABLED(CONFIG_IPV6)
 int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num);
 int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num);
diff --git a/net/core/dev.c b/net/core/dev.c
index fb99f64..1578fd7 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3893,6 +3893,7 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff
 		NAPI_GRO_CB(skb)->same_flow = 0;
 		NAPI_GRO_CB(skb)->flush = 0;
 		NAPI_GRO_CB(skb)->free = 0;
+		NAPI_GRO_CB(skb)->udp_mark = 0;
 
 		pp = ptype->callbacks.gro_receive(&napi->gro_list, skb);
 		break;
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index 79c62bd..ee853c5 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -14,6 +14,15 @@
 #include <net/udp.h>
 #include <net/protocol.h>
 
+static DEFINE_SPINLOCK(udp_offload_lock);
+static struct udp_offload_priv *udp_offload_base __read_mostly;
+
+struct udp_offload_priv {
+	struct udp_offload	*offload;
+	struct rcu_head		rcu;
+	struct udp_offload_priv __rcu *next;
+};
+
 static int udp4_ufo_send_check(struct sk_buff *skb)
 {
 	if (!pskb_may_pull(skb, sizeof(struct udphdr)))
@@ -89,10 +98,144 @@ out:
 	return segs;
 }
 
+int udp_add_offload(struct udp_offload *uo)
+{
+	struct udp_offload_priv **head = &udp_offload_base;
+	struct udp_offload_priv *new_offload = kzalloc(sizeof(*new_offload), GFP_KERNEL);
+
+	if (!new_offload)
+		return -ENOMEM;
+
+	new_offload->offload = uo;
+
+	spin_lock(&udp_offload_lock);
+	rcu_assign_pointer(new_offload->next, rcu_dereference(*head));
+	rcu_assign_pointer(*head, rcu_dereference(new_offload));
+	spin_unlock(&udp_offload_lock);
+
+	return 0;
+}
+EXPORT_SYMBOL(udp_add_offload);
+
+static void udp_offload_free_routine(struct rcu_head *head)
+{
+	struct udp_offload_priv *ou_priv = container_of(head, struct udp_offload_priv, rcu);
+	kfree(ou_priv);
+}
+
+void udp_del_offload(struct udp_offload *uo)
+{
+	struct udp_offload_priv __rcu **head = &udp_offload_base;
+	struct udp_offload_priv *uo_priv;
+
+	spin_lock(&udp_offload_lock);
+
+	uo_priv = rcu_dereference(*head);
+	for (; uo_priv != NULL;
+		uo_priv = rcu_dereference(*head)) {
+
+		if (uo_priv->offload == uo) {
+			rcu_assign_pointer(*head, rcu_dereference(uo_priv->next));
+			goto unlock;
+		}
+		head = &uo_priv->next;
+	}
+	pr_warn("udp_del_offload: didn't find offload for port %d\n", htons(uo->port));
+unlock:
+	spin_unlock(&udp_offload_lock);
+	if (uo_priv != NULL)
+		call_rcu(&uo_priv->rcu, udp_offload_free_routine);
+}
+EXPORT_SYMBOL(udp_del_offload);
+
+static struct sk_buff **udp_gro_receive(struct sk_buff **head, struct sk_buff *skb)
+{
+	struct udp_offload_priv *uo_priv;
+	struct sk_buff *p, **pp = NULL;
+	struct udphdr *uh, *uh2;
+	unsigned int hlen, off;
+	int flush = 1;
+
+	if (NAPI_GRO_CB(skb)->udp_mark ||
+	    (!skb->encapsulation && skb->ip_summed != CHECKSUM_COMPLETE))
+		goto out;
+
+	/* mark that this skb passed once through the udp gro layer */
+	NAPI_GRO_CB(skb)->udp_mark = 1;
+
+	off  = skb_gro_offset(skb);
+	hlen = off + sizeof(*uh);
+	uh   = skb_gro_header_fast(skb, off);
+	if (skb_gro_header_hard(skb, hlen)) {
+		uh = skb_gro_header_slow(skb, hlen, off);
+		if (unlikely(!uh))
+			goto out;
+	}
+
+	rcu_read_lock();
+	uo_priv = rcu_dereference(udp_offload_base);
+	for (; uo_priv != NULL; uo_priv = rcu_dereference(uo_priv->next)) {
+		if (uo_priv->offload->port == uh->dest &&
+		    uo_priv->offload->callbacks.gro_receive)
+			goto unflush;
+	}
+	goto out_unlock;
+
+unflush:
+	flush = 0;
+
+	for (p = *head; p; p = p->next) {
+		if (!NAPI_GRO_CB(p)->same_flow)
+			continue;
+
+		uh2 = (struct udphdr   *)(p->data + off);
+		if ((*(u32 *)&uh->source != *(u32 *)&uh2->source)) {
+			NAPI_GRO_CB(p)->same_flow = 0;
+			continue;
+		}
+	}
+
+	skb_gro_pull(skb, sizeof(struct udphdr)); /* pull encapsulating udp header */
+	pp = uo_priv->offload->callbacks.gro_receive(head, skb);
+
+out_unlock:
+	rcu_read_unlock();
+out:
+	NAPI_GRO_CB(skb)->flush |= flush;
+	return pp;
+}
+
+static int udp_gro_complete(struct sk_buff *skb, int nhoff)
+{
+	struct udp_offload_priv *uo_priv;
+	__be16 newlen = htons(skb->len - nhoff);
+	struct udphdr *uh = (struct udphdr *)(skb->data + nhoff);
+	int err = -ENOSYS;
+
+	uh->len = newlen;
+
+	rcu_read_lock();
+
+	uo_priv = rcu_dereference(udp_offload_base);
+	for (; uo_priv != NULL; uo_priv = rcu_dereference(uo_priv->next)) {
+		if (uo_priv->offload->port == uh->dest &&
+		    uo_priv->offload->callbacks.gro_complete)
+			break;
+	}
+
+	if (uo_priv != NULL)
+		err = uo_priv->offload->callbacks.gro_complete(skb, nhoff + sizeof(struct udphdr));
+
+	rcu_read_unlock();
+	return err;
+}
+
 static const struct net_offload udpv4_offload = {
 	.callbacks = {
 		.gso_send_check = udp4_ufo_send_check,
 		.gso_segment = udp4_ufo_fragment,
+		.gro_receive  =	udp_gro_receive,
+		.gro_complete =	udp_gro_complete,
 	},
 };
 
-- 
1.7.1

^ permalink raw reply related

* [PATCH V5 net-next 3/3] net: Add GRO support for vxlan traffic
From: Or Gerlitz @ 2014-01-20 11:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, hkchu, edumazet, herbert, yanb, shlomop, therbert,
	Or Gerlitz
In-Reply-To: <1390219161-9881-1-git-send-email-ogerlitz@mellanox.com>

Add GRO handlers for vxlann, by using the UDP GRO infrastructure.

For single TCP session that goes through vxlan tunneling I got nice
improvement from 6.8Gbs to 11.5Gbs

--> UDP/VXLAN GRO disabled
$ netperf  -H 192.168.52.147 -c -C

$ netperf -t TCP_STREAM -H 192.168.52.147 -c -C
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.52.147 () port 0 AF_INET
Recv   Send    Send                          Utilization       Service Demand
Socket Socket  Message  Elapsed              Send     Recv     Send    Recv
Size   Size    Size     Time     Throughput  local    remote   local   remote
bytes  bytes   bytes    secs.    10^6bits/s  % S      % S      us/KB   us/KB

 87380  65536  65536    10.00      6799.75   12.54    24.79    0.604   1.195

--> UDP/VXLAN GRO enabled

$ netperf -t TCP_STREAM -H 192.168.52.147 -c -C
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.52.147 () port 0 AF_INET
Recv   Send    Send                          Utilization       Service Demand
Socket Socket  Message  Elapsed              Send     Recv     Send    Recv
Size   Size    Size     Time     Throughput  local    remote   local   remote
bytes  bytes   bytes    secs.    10^6bits/s  % S      % S      us/KB   us/KB

 87380  65536  65536    10.00      11562.72   24.90    20.34    0.706   0.577

Signed-off-by: Shlomo Pongratz <shlomop@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
 drivers/net/vxlan.c |  117 +++++++++++++++++++++++++++++++++++++++++++++++---
 include/net/vxlan.h |    1 +
 2 files changed, 111 insertions(+), 7 deletions(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index d6ec71f..2e731f1 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -40,6 +40,7 @@
 #include <net/net_namespace.h>
 #include <net/netns/generic.h>
 #include <net/vxlan.h>
+#include <net/protocol.h>
 #if IS_ENABLED(CONFIG_IPV6)
 #include <net/ipv6.h>
 #include <net/addrconf.h>
@@ -554,13 +555,106 @@ static int vxlan_fdb_append(struct vxlan_fdb *f,
 	return 1;
 }
 
+static struct sk_buff **vxlan_gro_receive(struct sk_buff **head, struct sk_buff *skb)
+{
+	struct sk_buff *p, **pp = NULL;
+	struct vxlanhdr *vh, *vh2;
+	struct ethhdr *eh, *eh2;
+	unsigned int hlen, off_vx, off_eth;
+	const struct packet_offload *ptype;
+	__be16 type;
+	int flush = 1;
+
+	off_vx = skb_gro_offset(skb);
+	hlen = off_vx + sizeof(*vh);
+	vh   = skb_gro_header_fast(skb, off_vx);
+	if (skb_gro_header_hard(skb, hlen)) {
+		vh = skb_gro_header_slow(skb, hlen, off_vx);
+		if (unlikely(!vh))
+			goto out;
+	}
+	skb_gro_pull(skb, sizeof(struct vxlanhdr)); /* pull vxlan header */
+
+	off_eth = skb_gro_offset(skb);
+	hlen = off_eth + sizeof(*eh);
+	eh   = skb_gro_header_fast(skb, off_eth);
+	if (skb_gro_header_hard(skb, hlen)) {
+		eh = skb_gro_header_slow(skb, hlen, off_eth);
+		if (unlikely(!eh))
+			goto out;
+	}
+
+	flush = 0;
+
+	for (p = *head; p; p = p->next) {
+		if (!NAPI_GRO_CB(p)->same_flow)
+			continue;
+
+		vh2 = (struct vxlanhdr *)(p->data + off_vx);
+		eh2 = (struct ethhdr   *)(p->data + off_eth);
+		if (vh->vx_vni != vh2->vx_vni || compare_ether_header(eh, eh2)) {
+			NAPI_GRO_CB(p)->same_flow = 0;
+			continue;
+		}
+		goto found;
+	}
+
+found:
+	type = eh->h_proto;
+
+	rcu_read_lock();
+	ptype = gro_find_receive_by_type(type);
+	if (ptype == NULL) {
+		flush = 1;
+		goto out_unlock;
+	}
+
+	skb_gro_pull(skb, sizeof(*eh)); /* pull inner eth header */
+	pp = ptype->callbacks.gro_receive(head, skb);
+
+out_unlock:
+	rcu_read_unlock();
+out:
+	NAPI_GRO_CB(skb)->flush |= flush;
+
+	return pp;
+}
+
+static int vxlan_gro_complete(struct sk_buff *skb, int nhoff)
+{
+	struct ethhdr *eh;
+	struct packet_offload *ptype;
+	__be16 type;
+	int vxlan_len  = sizeof(struct vxlanhdr) + sizeof(struct ethhdr);
+	int err = -ENOSYS;
+
+	eh = (struct ethhdr *)(skb->data + nhoff + sizeof(struct vxlanhdr));
+	type = eh->h_proto;
+
+	rcu_read_lock();
+	ptype = gro_find_complete_by_type(type);
+	if (ptype != NULL)
+		err = ptype->callbacks.gro_complete(skb, nhoff + vxlan_len);
+
+	rcu_read_unlock();
+	return err;
+}
+
 /* Notify netdevs that UDP port started listening */
-static void vxlan_notify_add_rx_port(struct sock *sk)
+static void vxlan_notify_add_rx_port(struct vxlan_sock *vs)
 {
 	struct net_device *dev;
+	struct sock *sk = vs->sock->sk;
 	struct net *net = sock_net(sk);
 	sa_family_t sa_family = sk->sk_family;
 	__be16 port = inet_sk(sk)->inet_sport;
+	int err;
+
+	if (sa_family == AF_INET) {
+		err = udp_add_offload(&vs->udp_offloads);
+		if (err)
+			pr_warn("vxlan: udp_add_offload failed with status %d\n", err);
+	}
 
 	rcu_read_lock();
 	for_each_netdev_rcu(net, dev) {
@@ -572,9 +666,10 @@ static void vxlan_notify_add_rx_port(struct sock *sk)
 }
 
 /* Notify netdevs that UDP port is no more listening */
-static void vxlan_notify_del_rx_port(struct sock *sk)
+static void vxlan_notify_del_rx_port(struct vxlan_sock *vs)
 {
 	struct net_device *dev;
+	struct sock *sk = vs->sock->sk;
 	struct net *net = sock_net(sk);
 	sa_family_t sa_family = sk->sk_family;
 	__be16 port = inet_sk(sk)->inet_sport;
@@ -586,6 +681,9 @@ static void vxlan_notify_del_rx_port(struct sock *sk)
 							    port);
 	}
 	rcu_read_unlock();
+
+	if (sa_family == AF_INET)
+		udp_del_offload(&vs->udp_offloads);
 }
 
 /* Add new entry to forwarding table -- assumes lock held */
@@ -963,7 +1061,7 @@ void vxlan_sock_release(struct vxlan_sock *vs)
 	spin_lock(&vn->sock_lock);
 	hlist_del_rcu(&vs->hlist);
 	rcu_assign_sk_user_data(vs->sock->sk, NULL);
-	vxlan_notify_del_rx_port(sk);
+	vxlan_notify_del_rx_port(vs);
 	spin_unlock(&vn->sock_lock);
 
 	queue_work(vxlan_wq, &vs->del_work);
@@ -1124,8 +1222,8 @@ static void vxlan_rcv(struct vxlan_sock *vs,
 	 * leave the CHECKSUM_UNNECESSARY, the device checksummed it
 	 * for us. Otherwise force the upper layers to verify it.
 	 */
-	if (skb->ip_summed != CHECKSUM_UNNECESSARY || !skb->encapsulation ||
-	    !(vxlan->dev->features & NETIF_F_RXCSUM))
+	if ((skb->ip_summed != CHECKSUM_UNNECESSARY && skb->ip_summed != CHECKSUM_PARTIAL) ||
+	    !skb->encapsulation || !(vxlan->dev->features & NETIF_F_RXCSUM))
 		skb->ip_summed = CHECKSUM_NONE;
 
 	skb->encapsulation = 0;
@@ -2303,7 +2401,7 @@ static struct vxlan_sock *vxlan_socket_create(struct net *net, __be16 port,
 	struct sock *sk;
 	unsigned int h;
 
-	vs = kmalloc(sizeof(*vs), GFP_KERNEL);
+	vs = kzalloc(sizeof(*vs), GFP_KERNEL);
 	if (!vs)
 		return ERR_PTR(-ENOMEM);
 
@@ -2328,9 +2426,14 @@ static struct vxlan_sock *vxlan_socket_create(struct net *net, __be16 port,
 	vs->data = data;
 	rcu_assign_sk_user_data(vs->sock->sk, vs);
 
+	/* Initialize the vxlan udp offloads structure */
+	vs->udp_offloads.port = port;
+	vs->udp_offloads.callbacks.gro_receive  = vxlan_gro_receive;
+	vs->udp_offloads.callbacks.gro_complete = vxlan_gro_complete;
+
 	spin_lock(&vn->sock_lock);
 	hlist_add_head_rcu(&vs->hlist, vs_head(net, port));
-	vxlan_notify_add_rx_port(sk);
+	vxlan_notify_add_rx_port(vs);
 	spin_unlock(&vn->sock_lock);
 
 	/* Mark socket as an encapsulation socket. */
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index 6b6d180..5deef1a 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -21,6 +21,7 @@ struct vxlan_sock {
 	struct rcu_head	  rcu;
 	struct hlist_head vni_list[VNI_HASH_SIZE];
 	atomic_t	  refcnt;
+	struct udp_offload udp_offloads;
 };
 
 struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port,
-- 
1.7.1

^ permalink raw reply related

* Re: [PATCH v5] can: add Renesas R-Car CAN driver
From: Ben Dooks @ 2014-01-20 12:02 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: Geert Uytterhoeven, Sergei Shtylyov, netdev@vger.kernel.org, wg,
	linux-can, Linux-sh list, vksavl
In-Reply-To: <52DD0F72.1000005@pengutronix.de>

On 20/01/14 11:58, Marc Kleine-Budde wrote:
> On 01/20/2014 12:52 PM, Geert Uytterhoeven wrote:
>> On Mon, Jan 20, 2014 at 12:47 PM, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
>>> On 01/20/2014 12:43 PM, Geert Uytterhoeven wrote:
>>>> On Thu, Dec 26, 2013 at 10:37 PM, Sergei Shtylyov
>>>> <sergei.shtylyov@cogentembedded.com> wrote:
>>>>> Changes in version 3:
>>>>
>>>>> - added '__packed' to 'struct rcar_can_mbox_regs' and 'struct rcar_can_regs';
>>>>> - removed unneeded type cast in the probe() method.
>>>>
>>>>> +/* Mailbox registers structure */
>>>>> +struct rcar_can_mbox_regs {
>>>>> +       u32 id;         /* IDE and RTR bits, SID and EID */
>>>>> +       u8 stub;        /* Not used */
>>>>> +       u8 dlc;         /* Data Length Code - bits [0..3] */
>>>>> +       u8 data[8];     /* Data Bytes */
>>>>> +       u8 tsh;         /* Time Stamp Higher Byte */
>>>>> +       u8 tsl;         /* Time Stamp Lower Byte */
>>>>> +} __packed;
>>>>
>>>> Sorry, I missed the earlier discussion, but why the _packed?
>>>> One u32 and 12 bytes makes a nice multiple of 4.
>>>
>>> Better safe than sorry, it's the layout of the registers in hardware,
>>> don't let the compiler optimize here.
>>
>> Actually __packed makes it less safe, as the compiler now assumes
>> the u32 id member is unaligned, and thus may turn 32-bit accesses into 4
>> byte accesses.
>>
>> Fortunately it won't happen in this case as the code uses writel/readl to
>> acces the id member.
>
> Yes, as this are registers they must not be accessed directly. However
> we can use "__attribute__ ((packed, aligned(4)))" to tell the compiler
> that the base address of this struct is always aligned to 4 bytes.

I thought we'd gotten past the stage of ever writing register
definitions as structures?

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

^ permalink raw reply

* Re: [PATCH v5] can: add Renesas R-Car CAN driver
From: Geert Uytterhoeven @ 2014-01-20 12:05 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Marc Kleine-Budde, Sergei Shtylyov, netdev@vger.kernel.org, wg,
	linux-can, Linux-sh list, Pavel Kiryukhin
In-Reply-To: <52DD1058.4090205@codethink.co.uk>

On Mon, Jan 20, 2014 at 1:02 PM, Ben Dooks <ben.dooks@codethink.co.uk> wrote:
> On 20/01/14 11:58, Marc Kleine-Budde wrote:
>>
>> On 01/20/2014 12:52 PM, Geert Uytterhoeven wrote:
>>>
>>> On Mon, Jan 20, 2014 at 12:47 PM, Marc Kleine-Budde <mkl@pengutronix.de>
>>> wrote:
>>>>
>>>> On 01/20/2014 12:43 PM, Geert Uytterhoeven wrote:
>>>>>
>>>>> On Thu, Dec 26, 2013 at 10:37 PM, Sergei Shtylyov
>>>>> <sergei.shtylyov@cogentembedded.com> wrote:
>>>>>>
>>>>>> Changes in version 3:
>>>>>
>>>>>
>>>>>> - added '__packed' to 'struct rcar_can_mbox_regs' and 'struct
>>>>>> rcar_can_regs';
>>>>>> - removed unneeded type cast in the probe() method.
>>>>>
>>>>>
>>>>>> +/* Mailbox registers structure */
>>>>>> +struct rcar_can_mbox_regs {
>>>>>> +       u32 id;         /* IDE and RTR bits, SID and EID */
>>>>>> +       u8 stub;        /* Not used */
>>>>>> +       u8 dlc;         /* Data Length Code - bits [0..3] */
>>>>>> +       u8 data[8];     /* Data Bytes */
>>>>>> +       u8 tsh;         /* Time Stamp Higher Byte */
>>>>>> +       u8 tsl;         /* Time Stamp Lower Byte */
>>>>>> +} __packed;
>>>>>
>>>>>
>>>>> Sorry, I missed the earlier discussion, but why the _packed?
>>>>> One u32 and 12 bytes makes a nice multiple of 4.
>>>>
>>>>
>>>> Better safe than sorry, it's the layout of the registers in hardware,
>>>> don't let the compiler optimize here.
>>>
>>>
>>> Actually __packed makes it less safe, as the compiler now assumes
>>> the u32 id member is unaligned, and thus may turn 32-bit accesses into 4
>>> byte accesses.
>>>
>>> Fortunately it won't happen in this case as the code uses writel/readl to
>>> acces the id member.
>>
>>
>> Yes, as this are registers they must not be accessed directly. However
>> we can use "__attribute__ ((packed, aligned(4)))" to tell the compiler
>> that the base address of this struct is always aligned to 4 bytes.
>
> I thought we'd gotten past the stage of ever writing register
> definitions as structures?

It allows to use e.g. "readl(&base->field)", which is used all over the place.

And sparse will inform you (read: the person who runs it) if you access
it directly.

Note that this driver does not use direct accesses.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply

* Re: [PATCH v5] can: add Renesas R-Car CAN driver
From: Marc Kleine-Budde @ 2014-01-20 12:05 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Geert Uytterhoeven, Sergei Shtylyov, netdev@vger.kernel.org, wg,
	linux-can, Linux-sh list, vksavl
In-Reply-To: <52DD1058.4090205@codethink.co.uk>

[-- Attachment #1: Type: text/plain, Size: 2352 bytes --]

On 01/20/2014 01:02 PM, Ben Dooks wrote:
> On 20/01/14 11:58, Marc Kleine-Budde wrote:
>> On 01/20/2014 12:52 PM, Geert Uytterhoeven wrote:
>>> On Mon, Jan 20, 2014 at 12:47 PM, Marc Kleine-Budde
>>> <mkl@pengutronix.de> wrote:
>>>> On 01/20/2014 12:43 PM, Geert Uytterhoeven wrote:
>>>>> On Thu, Dec 26, 2013 at 10:37 PM, Sergei Shtylyov
>>>>> <sergei.shtylyov@cogentembedded.com> wrote:
>>>>>> Changes in version 3:
>>>>>
>>>>>> - added '__packed' to 'struct rcar_can_mbox_regs' and 'struct
>>>>>> rcar_can_regs';
>>>>>> - removed unneeded type cast in the probe() method.
>>>>>
>>>>>> +/* Mailbox registers structure */
>>>>>> +struct rcar_can_mbox_regs {
>>>>>> +       u32 id;         /* IDE and RTR bits, SID and EID */
>>>>>> +       u8 stub;        /* Not used */
>>>>>> +       u8 dlc;         /* Data Length Code - bits [0..3] */
>>>>>> +       u8 data[8];     /* Data Bytes */
>>>>>> +       u8 tsh;         /* Time Stamp Higher Byte */
>>>>>> +       u8 tsl;         /* Time Stamp Lower Byte */
>>>>>> +} __packed;
>>>>>
>>>>> Sorry, I missed the earlier discussion, but why the _packed?
>>>>> One u32 and 12 bytes makes a nice multiple of 4.
>>>>
>>>> Better safe than sorry, it's the layout of the registers in hardware,
>>>> don't let the compiler optimize here.
>>>
>>> Actually __packed makes it less safe, as the compiler now assumes
>>> the u32 id member is unaligned, and thus may turn 32-bit accesses into 4
>>> byte accesses.
>>>
>>> Fortunately it won't happen in this case as the code uses
>>> writel/readl to
>>> acces the id member.
>>
>> Yes, as this are registers they must not be accessed directly. However
>> we can use "__attribute__ ((packed, aligned(4)))" to tell the compiler
>> that the base address of this struct is always aligned to 4 bytes.
> 
> I thought we'd gotten past the stage of ever writing register
> definitions as structures?

I don't care whether to use offsets defined by a #define or an enum or a
struct. What's the "official" preference? Is it documented somewhere?

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]

^ permalink raw reply

* Re: [PATCH net-next 0/2] sctp: some small clean ups
From: Wang Weidong @ 2014-01-20 12:06 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: nhorman, davem, vyasevich, netdev, linux-sctp
In-Reply-To: <52DD0A62.9050807@redhat.com>

On 2014/1/20 19:37, Daniel Borkmann wrote:
> On 01/20/2014 12:27 PM, Wang Weidong wrote:
>> We have the macros in sctp.h, so use them for coding accordance
>> in sctp.
> 
> Thanks for doing this Wang.
> 
> I am actually wondering why we have these macro locking wrappers

Here, I didn't found any description about it. In v2.6.12-rc2, the sctp
use these macros.

> and not use these functions directly? Hm, any reasons? Maybe we
> should rather go in the other direction with this?
> 

Yeah. 
Should I do the other direction for clean ups now?

Regards,
Wang

>> Wang Weidong (2):
>>    sctp: use sctp_local_bh_{disable|enable} instead
>>      local_bh_{disable|enable}
>>    sctp: use sctp_read_[un]lock instead of read_[un]lock
>>
>>   net/sctp/endpointola.c   |  4 ++--
>>   net/sctp/input.c         | 10 +++++-----
>>   net/sctp/proc.c          | 12 ++++++------
>>   net/sctp/sm_make_chunk.c |  8 ++++----
>>   net/sctp/socket.c        |  8 ++++----
>>   5 files changed, 21 insertions(+), 21 deletions(-)
>>
> 
> 

^ permalink raw reply

* Re: [PATCH v5] can: add Renesas R-Car CAN driver
From: Marc Kleine-Budde @ 2014-01-20 12:08 UTC (permalink / raw)
  To: Geert Uytterhoeven, Ben Dooks
  Cc: Sergei Shtylyov, netdev@vger.kernel.org, wg, linux-can,
	Linux-sh list, Pavel Kiryukhin
In-Reply-To: <CAMuHMdUYcGRRg_XWQKVJMqcUHBLGCRJvtqXH1Uvz0odgoYydOg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2702 bytes --]

On 01/20/2014 01:05 PM, Geert Uytterhoeven wrote:
> On Mon, Jan 20, 2014 at 1:02 PM, Ben Dooks <ben.dooks@codethink.co.uk> wrote:
>> On 20/01/14 11:58, Marc Kleine-Budde wrote:
>>>
>>> On 01/20/2014 12:52 PM, Geert Uytterhoeven wrote:
>>>>
>>>> On Mon, Jan 20, 2014 at 12:47 PM, Marc Kleine-Budde <mkl@pengutronix.de>
>>>> wrote:
>>>>>
>>>>> On 01/20/2014 12:43 PM, Geert Uytterhoeven wrote:
>>>>>>
>>>>>> On Thu, Dec 26, 2013 at 10:37 PM, Sergei Shtylyov
>>>>>> <sergei.shtylyov@cogentembedded.com> wrote:
>>>>>>>
>>>>>>> Changes in version 3:
>>>>>>
>>>>>>
>>>>>>> - added '__packed' to 'struct rcar_can_mbox_regs' and 'struct
>>>>>>> rcar_can_regs';
>>>>>>> - removed unneeded type cast in the probe() method.
>>>>>>
>>>>>>
>>>>>>> +/* Mailbox registers structure */
>>>>>>> +struct rcar_can_mbox_regs {
>>>>>>> +       u32 id;         /* IDE and RTR bits, SID and EID */
>>>>>>> +       u8 stub;        /* Not used */
>>>>>>> +       u8 dlc;         /* Data Length Code - bits [0..3] */
>>>>>>> +       u8 data[8];     /* Data Bytes */
>>>>>>> +       u8 tsh;         /* Time Stamp Higher Byte */
>>>>>>> +       u8 tsl;         /* Time Stamp Lower Byte */
>>>>>>> +} __packed;
>>>>>>
>>>>>>
>>>>>> Sorry, I missed the earlier discussion, but why the _packed?
>>>>>> One u32 and 12 bytes makes a nice multiple of 4.
>>>>>
>>>>>
>>>>> Better safe than sorry, it's the layout of the registers in hardware,
>>>>> don't let the compiler optimize here.
>>>>
>>>>
>>>> Actually __packed makes it less safe, as the compiler now assumes
>>>> the u32 id member is unaligned, and thus may turn 32-bit accesses into 4
>>>> byte accesses.
>>>>
>>>> Fortunately it won't happen in this case as the code uses writel/readl to
>>>> acces the id member.
>>>
>>>
>>> Yes, as this are registers they must not be accessed directly. However
>>> we can use "__attribute__ ((packed, aligned(4)))" to tell the compiler
>>> that the base address of this struct is always aligned to 4 bytes.
>>
>> I thought we'd gotten past the stage of ever writing register
>> definitions as structures?
> 
> It allows to use e.g. "readl(&base->field)", which is used all over the place.
> 
> And sparse will inform you (read: the person who runs it) if you access
> it directly.

I'm doing this (however just started using additional -D__CHECK_FOO___),
before applying patches to my tree.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]

^ permalink raw reply

* [net-next PATCH 1/1] drivers: net: cpsw: enable promiscuous mode support
From: Mugunthan V N @ 2014-01-20 12:08 UTC (permalink / raw)
  To: netdev; +Cc: davem, linux-omap, Mugunthan V N

Enable promiscuous mode support for CPSW.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 drivers/net/ethernet/ti/cpsw.c     | 101 ++++++++++++++++++++++++++++---------
 drivers/net/ethernet/ti/cpsw_ale.c |  16 ++++++
 drivers/net/ethernet/ti/cpsw_ale.h |   2 +
 3 files changed, 94 insertions(+), 25 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index e8bb77d..21bbdcb 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -541,14 +541,89 @@ static inline int cpsw_get_slave_port(struct cpsw_priv *priv, u32 slave_num)
 		return slave_num;
 }
 
+static void cpsw_set_promiscious(struct net_device *ndev, bool enable)
+{
+	struct cpsw_priv *priv = netdev_priv(ndev);
+	struct cpsw_ale *ale = priv->ale;
+
+	if (priv->data.dual_emac) {
+		/* Enabling promiscuous mode for one interface will be
+		 * common for both the interface as the interface shares
+		 * the same hardware resource.
+		 */
+		if (!enable && ((priv->slaves[0].ndev->flags & IFF_PROMISC) ||
+				(priv->slaves[1].ndev->flags & IFF_PROMISC))) {
+			enable = true;
+			dev_err(&ndev->dev, "promiscuity not disabled as the other interface is still in promiscuity mode\n");
+		}
+
+		if (enable) {
+			/* Enable Bypass */
+			cpsw_ale_control_set(ale, 0, ALE_BYPASS, 1);
+
+			dev_dbg(&ndev->dev, "promiscuity enabled\n");
+		} else {
+			/* Disable Bypass */
+			cpsw_ale_control_set(ale, 0, ALE_BYPASS, 0);
+			dev_dbg(&ndev->dev, "promiscuity disabled\n");
+		}
+	} else {
+		int i;
+
+		if (enable) {
+			unsigned long timeout = jiffies + HZ;
+
+			/* Disable Learn for all ports */
+			for (i = 0; i <= priv->data.slaves; i++) {
+				cpsw_ale_control_set(ale, i,
+						     ALE_PORT_NOLEARN, 1);
+				cpsw_ale_control_set(ale, i,
+						     ALE_PORT_NO_SA_UPDATE, 1);
+			}
+
+			/* Clear All Untouched entries */
+			cpsw_ale_control_set(ale, 0, ALE_AGEOUT, 1);
+			do {
+				cpu_relax();
+				if (cpsw_ale_control_get(ale, 0, ALE_AGEOUT))
+					break;
+			} while (time_after(timeout, jiffies));
+			cpsw_ale_control_set(ale, 0, ALE_AGEOUT, 1);
+
+			/* Clear all mcast from ALE */
+			cpsw_ale_flush_multicast(ale, ALE_ALL_PORTS <<
+						 priv->host_port);
+
+			/* Flood All Unicast Packets to Host port */
+			cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 1);
+			dev_dbg(&ndev->dev, "promiscuity enabled\n");
+		} else {
+			/* Flood All Unicast Packets to Host port */
+			cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 0);
+
+			/* Enable Learn for all ports */
+			for (i = 0; i <= priv->data.slaves; i++) {
+				cpsw_ale_control_set(ale, i,
+						     ALE_PORT_NOLEARN, 0);
+				cpsw_ale_control_set(ale, i,
+						     ALE_PORT_NO_SA_UPDATE, 0);
+			}
+			dev_dbg(&ndev->dev, "promiscuity disabled\n");
+		}
+	}
+}
+
 static void cpsw_ndo_set_rx_mode(struct net_device *ndev)
 {
 	struct cpsw_priv *priv = netdev_priv(ndev);
 
 	if (ndev->flags & IFF_PROMISC) {
 		/* Enable promiscuous mode */
-		dev_err(priv->dev, "Ignoring Promiscuous mode\n");
+		cpsw_set_promiscious(ndev, true);
 		return;
+	} else {
+		/* Disable promiscuous mode */
+		cpsw_set_promiscious(ndev, false);
 	}
 
 	/* Clear all mcast from ALE */
@@ -1257,29 +1332,6 @@ fail:
 	return NETDEV_TX_BUSY;
 }
 
-static void cpsw_ndo_change_rx_flags(struct net_device *ndev, int flags)
-{
-	/*
-	 * The switch cannot operate in promiscuous mode without substantial
-	 * headache.  For promiscuous mode to work, we would need to put the
-	 * ALE in bypass mode and route all traffic to the host port.
-	 * Subsequently, the host will need to operate as a "bridge", learn,
-	 * and flood as needed.  For now, we simply complain here and
-	 * do nothing about it :-)
-	 */
-	if ((flags & IFF_PROMISC) && (ndev->flags & IFF_PROMISC))
-		dev_err(&ndev->dev, "promiscuity ignored!\n");
-
-	/*
-	 * The switch cannot filter multicast traffic unless it is configured
-	 * in "VLAN Aware" mode.  Unfortunately, VLAN awareness requires a
-	 * whole bunch of additional logic that this driver does not implement
-	 * at present.
-	 */
-	if ((flags & IFF_ALLMULTI) && !(ndev->flags & IFF_ALLMULTI))
-		dev_err(&ndev->dev, "multicast traffic cannot be filtered!\n");
-}
-
 #ifdef CONFIG_TI_CPTS
 
 static void cpsw_hwtstamp_v1(struct cpsw_priv *priv)
@@ -1575,7 +1627,6 @@ static const struct net_device_ops cpsw_netdev_ops = {
 	.ndo_open		= cpsw_ndo_open,
 	.ndo_stop		= cpsw_ndo_stop,
 	.ndo_start_xmit		= cpsw_ndo_start_xmit,
-	.ndo_change_rx_flags	= cpsw_ndo_change_rx_flags,
 	.ndo_set_mac_address	= cpsw_ndo_set_mac_address,
 	.ndo_do_ioctl		= cpsw_ndo_ioctl,
 	.ndo_validate_addr	= eth_validate_addr,
diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
index 63e9819..7f89306 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.c
+++ b/drivers/net/ethernet/ti/cpsw_ale.c
@@ -477,6 +477,14 @@ static const struct ale_control_info ale_controls[ALE_NUM_CONTROLS] = {
 		.port_shift	= 0,
 		.bits		= 1,
 	},
+	[ALE_P0_UNI_FLOOD]	= {
+		.name		= "port0_unicast_flood",
+		.offset		= ALE_CONTROL,
+		.port_offset	= 0,
+		.shift		= 8,
+		.port_shift	= 0,
+		.bits		= 1,
+	},
 	[ALE_VLAN_NOLEARN]	= {
 		.name		= "vlan_nolearn",
 		.offset		= ALE_CONTROL,
@@ -573,6 +581,14 @@ static const struct ale_control_info ale_controls[ALE_NUM_CONTROLS] = {
 		.port_shift	= 0,
 		.bits		= 1,
 	},
+	[ALE_PORT_NO_SA_UPDATE]	= {
+		.name		= "no_source_update",
+		.offset		= ALE_PORTCTL,
+		.port_offset	= 4,
+		.shift		= 5,
+		.port_shift	= 0,
+		.bits		= 1,
+	},
 	[ALE_PORT_MCAST_LIMIT]	= {
 		.name		= "mcast_limit",
 		.offset		= ALE_PORTCTL,
diff --git a/drivers/net/ethernet/ti/cpsw_ale.h b/drivers/net/ethernet/ti/cpsw_ale.h
index 30daa12..de409c3 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.h
+++ b/drivers/net/ethernet/ti/cpsw_ale.h
@@ -34,6 +34,7 @@ enum cpsw_ale_control {
 	ALE_ENABLE,
 	ALE_CLEAR,
 	ALE_AGEOUT,
+	ALE_P0_UNI_FLOOD,
 	ALE_VLAN_NOLEARN,
 	ALE_NO_PORT_VLAN,
 	ALE_OUI_DENY,
@@ -47,6 +48,7 @@ enum cpsw_ale_control {
 	ALE_PORT_DROP_UNTAGGED,
 	ALE_PORT_DROP_UNKNOWN_VLAN,
 	ALE_PORT_NOLEARN,
+	ALE_PORT_NO_SA_UPDATE,
 	ALE_PORT_UNKNOWN_VLAN_MEMBER,
 	ALE_PORT_UNKNOWN_MCAST_FLOOD,
 	ALE_PORT_UNKNOWN_REG_MCAST_FLOOD,
-- 
1.8.5.2.233.g932f7e4

^ permalink raw reply related

* Re: [PATCH v5] can: add Renesas R-Car CAN driver
From: Sergei Shtylyov @ 2014-01-20 12:12 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: netdev@vger.kernel.org, wg, mkl, linux-can, Linux-sh list, vksavl
In-Reply-To: <CAMuHMdWZJUvcW9OzM39aB2m+VdKqmZ6EOGR_rZcAdV7Cmwx3kg@mail.gmail.com>

Hello.

On 20-01-2014 15:43, Geert Uytterhoeven wrote:

>> Changes in version 3:

>> - added '__packed' to 'struct rcar_can_mbox_regs' and 'struct rcar_can_regs';
>> - removed unneeded type cast in the probe() method.

>> +/* Mailbox registers structure */
>> +struct rcar_can_mbox_regs {
>> +       u32 id;         /* IDE and RTR bits, SID and EID */
>> +       u8 stub;        /* Not used */
>> +       u8 dlc;         /* Data Length Code - bits [0..3] */
>> +       u8 data[8];     /* Data Bytes */
>> +       u8 tsh;         /* Time Stamp Higher Byte */
>> +       u8 tsl;         /* Time Stamp Lower Byte */
>> +} __packed;

> Sorry, I missed the earlier discussion, but why the _packed?
> One u32 and 12 bytes makes a nice multiple of 4.

    Mainly for consistency as this is a structure representing the hardware 
registers.

> Gr{oetje,eeting}s,

>                          Geert

WBR, Sergei


^ permalink raw reply

* RE: [PATCH v5] can: add Renesas R-Car CAN driver
From: David Laight @ 2014-01-20 12:13 UTC (permalink / raw)
  To: 'Ben Dooks', Marc Kleine-Budde
  Cc: Geert Uytterhoeven, Sergei Shtylyov, netdev@vger.kernel.org,
	wg@grandegger.com, linux-can@vger.kernel.org, Linux-sh list,
	vksavl@gmail.com
In-Reply-To: <52DD1058.4090205@codethink.co.uk>

From: 
> On 20/01/14 11:58, Marc Kleine-Budde wrote:
> > On 01/20/2014 12:52 PM, Geert Uytterhoeven wrote:
> >> On Mon, Jan 20, 2014 at 12:47 PM, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> >>> On 01/20/2014 12:43 PM, Geert Uytterhoeven wrote:
> >>>> On Thu, Dec 26, 2013 at 10:37 PM, Sergei Shtylyov
> >>>> <sergei.shtylyov@cogentembedded.com> wrote:
> >>>>> Changes in version 3:
> >>>>
> >>>>> - added '__packed' to 'struct rcar_can_mbox_regs' and 'struct rcar_can_regs';
> >>>>> - removed unneeded type cast in the probe() method.
> >>>>
> >>>>> +/* Mailbox registers structure */
> >>>>> +struct rcar_can_mbox_regs {
> >>>>> +       u32 id;         /* IDE and RTR bits, SID and EID */
> >>>>> +       u8 stub;        /* Not used */
> >>>>> +       u8 dlc;         /* Data Length Code - bits [0..3] */
> >>>>> +       u8 data[8];     /* Data Bytes */
> >>>>> +       u8 tsh;         /* Time Stamp Higher Byte */
> >>>>> +       u8 tsl;         /* Time Stamp Lower Byte */
> >>>>> +} __packed;
> >>>>
> >>>> Sorry, I missed the earlier discussion, but why the _packed?
> >>>> One u32 and 12 bytes makes a nice multiple of 4.
> >>>
> >>> Better safe than sorry, it's the layout of the registers in hardware,
> >>> don't let the compiler optimize here.

Why not just add a compile time check against the size of the
structure - that will ensure that no padding is accidentally added.

> >> Actually __packed makes it less safe, as the compiler now assumes
> >> the u32 id member is unaligned, and thus may turn 32-bit accesses into 4
> >> byte accesses.
> >>
> >> Fortunately it won't happen in this case as the code uses writel/readl to
> >> acces the id member.

Which means that it will be aligned (and must be aligned).
So the packed is completely useless and pointless.

> > Yes, as this are registers they must not be accessed directly. However
> > we can use "__attribute__ ((packed, aligned(4)))" to tell the compiler
> > that the base address of this struct is always aligned to 4 bytes.
> 
> I thought we'd gotten past the stage of ever writing register
> definitions as structures?

Any other way is likely to be more error prone since nothing
ties the offsets with the correct base address.

IMHO it is best to only specify packed if the structure is expected
to be misaligned. Misaligned members can be 'fixed' by marking them
aligned().

Even then you might want to define the structure itself without
the 'packed' and the define a second packed structure containing
a single member.

eg: you might have:

struct a {
	u32	a_1;
	u64	a_2 __attribute__((aligned(4)));
	u32	a_3;
};

struct a_packed {
	struct a p;
} __attribute__((packed));

You might even need a union of the two types!

	David


^ permalink raw reply

* Re: [Patch net-next 1/6] net_sched: act: fetch hinfo from a->ops->hinfo
From: Jamal Hadi Salim @ 2014-01-20 12:16 UTC (permalink / raw)
  To: Cong Wang, netdev; +Cc: David S. Miller
In-Reply-To: <1389987427-14085-2-git-send-email-xiyou.wangcong@gmail.com>

On 01/17/14 14:37, Cong Wang wrote:
> Every action ops has a pointer to hash info, so we don't need to
> hard-code it in each module.
>
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>

Although changes like the one below (which are in a few places)
are necessary i.e it was more readable before.


> diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c
> index ee28e1c..a9a3185 100644
> --- a/net/sched/act_csum.c
> +++ b/net/sched/act_csum.c

> -		tcf_hash_release(pc, bind, &csum_hash_info);
> +		tcf_hash_release(pc, bind, a->ops->hinfo);
>   		if (!ovr)

cheers,
jamal

^ permalink raw reply

* Re: [PATCH net-next 0/2] sctp: some small clean ups
From: Neil Horman @ 2014-01-20 12:20 UTC (permalink / raw)
  To: Daniel Borkmann; +Cc: Wang Weidong, davem, vyasevich, netdev, linux-sctp
In-Reply-To: <52DD0A62.9050807@redhat.com>

On Mon, Jan 20, 2014 at 12:37:06PM +0100, Daniel Borkmann wrote:
> On 01/20/2014 12:27 PM, Wang Weidong wrote:
> >We have the macros in sctp.h, so use them for coding accordance
> >in sctp.
> 
> Thanks for doing this Wang.
> 
> I am actually wondering why we have these macro locking wrappers
> and not use these functions directly? Hm, any reasons? Maybe we
> should rather go in the other direction with this?
> 
Its because in the origional implementation of the sctp protocol, there was a
user space test harness which built the kernel module for userspace execution to
cary our some unit testing on the code.  It did so by redefining some of those
locking macros to user space friendly code.  IIRC we haven't use those unit
tests in years, and so should be removing them, not adding them to other
locations.

Neil

> >Wang Weidong (2):
> >   sctp: use sctp_local_bh_{disable|enable} instead
> >     local_bh_{disable|enable}
> >   sctp: use sctp_read_[un]lock instead of read_[un]lock
> >
> >  net/sctp/endpointola.c   |  4 ++--
> >  net/sctp/input.c         | 10 +++++-----
> >  net/sctp/proc.c          | 12 ++++++------
> >  net/sctp/sm_make_chunk.c |  8 ++++----
> >  net/sctp/socket.c        |  8 ++++----
> >  5 files changed, 21 insertions(+), 21 deletions(-)
> >
> 

^ permalink raw reply

* Re: [PATCH net-next v2] xen-netback: Rework rx_work_todo
From: Zoltan Kiss @ 2014-01-20 12:23 UTC (permalink / raw)
  To: ian.campbell, wei.liu2, xen-devel, netdev, linux-kernel,
	jonathan.davies
  Cc: Paul Durrant
In-Reply-To: <1389805867-22409-1-git-send-email-zoltan.kiss@citrix.com>

Any reviews on this one? It fixes an important lockup situation, so 
either this or some other fix should go in soon.

On 15/01/14 17:11, Zoltan Kiss wrote:
> The recent patch to fix receive side flow control (11b57f) solved the spinning
> thread problem, however caused an another one. The receive side can stall, if:
> - [THREAD] xenvif_rx_action sets rx_queue_stopped to true
> - [INTERRUPT] interrupt happens, and sets rx_event to true
> - [THREAD] then xenvif_kthread sets rx_event to false
> - [THREAD] rx_work_todo doesn't return true anymore
>
> Also, if interrupt sent but there is still no room in the ring, it take quite a
> long time until xenvif_rx_action realize it. This patch ditch that two variable,
> and rework rx_work_todo. If the thread finds it can't fit more skb's into the
> ring, it saves the last slot estimation into rx_last_skb_slots, otherwise it's
> kept as 0. Then rx_work_todo will check if:
> - there is something to send to the ring (like before)
> - there is space for the topmost packet in the queue
>
> I think that's more natural and optimal thing to test than two bool which are
> set somewhere else.
>
> Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
> ---
>   drivers/net/xen-netback/common.h    |    6 +-----
>   drivers/net/xen-netback/interface.c |    1 -
>   drivers/net/xen-netback/netback.c   |   16 ++++++----------
>   3 files changed, 7 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
> index 4c76bcb..ae413a2 100644
> --- a/drivers/net/xen-netback/common.h
> +++ b/drivers/net/xen-netback/common.h
> @@ -143,11 +143,7 @@ struct xenvif {
>   	char rx_irq_name[IFNAMSIZ+4]; /* DEVNAME-rx */
>   	struct xen_netif_rx_back_ring rx;
>   	struct sk_buff_head rx_queue;
> -	bool rx_queue_stopped;
> -	/* Set when the RX interrupt is triggered by the frontend.
> -	 * The worker thread may need to wake the queue.
> -	 */
> -	bool rx_event;
> +	RING_IDX rx_last_skb_slots;
>
>   	/* This array is allocated seperately as it is large */
>   	struct gnttab_copy *grant_copy_op;
> diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
> index b9de31e..7669d49 100644
> --- a/drivers/net/xen-netback/interface.c
> +++ b/drivers/net/xen-netback/interface.c
> @@ -100,7 +100,6 @@ static irqreturn_t xenvif_rx_interrupt(int irq, void *dev_id)
>   {
>   	struct xenvif *vif = dev_id;
>
> -	vif->rx_event = true;
>   	xenvif_kick_thread(vif);
>
>   	return IRQ_HANDLED;
> diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
> index 2738563..bb241d0 100644
> --- a/drivers/net/xen-netback/netback.c
> +++ b/drivers/net/xen-netback/netback.c
> @@ -477,7 +477,6 @@ static void xenvif_rx_action(struct xenvif *vif)
>   	unsigned long offset;
>   	struct skb_cb_overlay *sco;
>   	bool need_to_notify = false;
> -	bool ring_full = false;
>
>   	struct netrx_pending_operations npo = {
>   		.copy  = vif->grant_copy_op,
> @@ -487,7 +486,7 @@ static void xenvif_rx_action(struct xenvif *vif)
>   	skb_queue_head_init(&rxq);
>
>   	while ((skb = skb_dequeue(&vif->rx_queue)) != NULL) {
> -		int max_slots_needed;
> +		RING_IDX max_slots_needed;
>   		int i;
>
>   		/* We need a cheap worse case estimate for the number of
> @@ -510,9 +509,10 @@ static void xenvif_rx_action(struct xenvif *vif)
>   		if (!xenvif_rx_ring_slots_available(vif, max_slots_needed)) {
>   			skb_queue_head(&vif->rx_queue, skb);
>   			need_to_notify = true;
> -			ring_full = true;
> +			vif->rx_last_skb_slots = max_slots_needed;
>   			break;
> -		}
> +		} else
> +			vif->rx_last_skb_slots = 0;
>
>   		sco = (struct skb_cb_overlay *)skb->cb;
>   		sco->meta_slots_used = xenvif_gop_skb(skb, &npo);
> @@ -523,8 +523,6 @@ static void xenvif_rx_action(struct xenvif *vif)
>
>   	BUG_ON(npo.meta_prod > ARRAY_SIZE(vif->meta));
>
> -	vif->rx_queue_stopped = !npo.copy_prod && ring_full;
> -
>   	if (!npo.copy_prod)
>   		goto done;
>
> @@ -1727,8 +1725,8 @@ static struct xen_netif_rx_response *make_rx_response(struct xenvif *vif,
>
>   static inline int rx_work_todo(struct xenvif *vif)
>   {
> -	return (!skb_queue_empty(&vif->rx_queue) && !vif->rx_queue_stopped) ||
> -		vif->rx_event;
> +	return !skb_queue_empty(&vif->rx_queue) &&
> +	       xenvif_rx_ring_slots_available(vif, vif->rx_last_skb_slots);
>   }
>
>   static inline int tx_work_todo(struct xenvif *vif)
> @@ -1814,8 +1812,6 @@ int xenvif_kthread(void *data)
>   		if (!skb_queue_empty(&vif->rx_queue))
>   			xenvif_rx_action(vif);
>
> -		vif->rx_event = false;
> -
>   		if (skb_queue_empty(&vif->rx_queue) &&
>   		    netif_queue_stopped(vif->dev))
>   			xenvif_start_queue(vif);
>

^ permalink raw reply

* RE: [PATCH net-next 3/4] ethtool: Support for configurable RSS hash key.
From: Venkata Duvvuru @ 2014-01-20 12:23 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev@vger.kernel.org
In-Reply-To: <1390156048.16433.114.camel@deadeye.wl.decadent.org.uk>



> -----Original Message-----
> From: Ben Hutchings [mailto:ben@decadent.org.uk]
> Sent: Sunday, January 19, 2014 11:57 PM
> To: Venkata Duvvuru
> Cc: netdev@vger.kernel.org
> Subject: Re: [PATCH net-next 3/4] ethtool: Support for configurable RSS hash
> key.
> 
> On Fri, 2014-01-17 at 13:02 +0000, Venkata Duvvuru wrote:
> > This ethtool patch primarily copies the ioctl command data structures
> from/to the User space and invokes the driver hook.
> [...]
> > --- a/include/uapi/linux/ethtool.h
> > +++ b/include/uapi/linux/ethtool.h
> > @@ -678,6 +678,22 @@ struct ethtool_rx_ntuple {
> >  	struct ethtool_rx_ntuple_flow_spec	fs;
> >  };
> >
> > +
> > +/**
> > + * struct ethtool_rss_hkey - command to set/get RSS hash key of the
> device.
> > + * @cmd: Command number -
> %ETHTOOL_SET_RSS_HKEY/ETHTOOL_GET_RSS_HKEY
> > + * @data: 40 or 16 byte rss hash key
> > + * @data_len: rss hash key length
> > + */
> > +
> > +#define RSS_HASH_KEY_LEN	40
> 
> This should have an 'ETHTOOL_' or 'ETH_' prefix.  But I wonder whether there
> should actually be a static maximum length.
> 
> > +/* RSS Hash key */
> > +struct ethtool_rss_hkey {
> > +	__u32   cmd;            /* ETHTOOL_SET/GET_RSS_HKEY */
> > +	__u8    data[RSS_HASH_KEY_LEN];
> > +	__u32	data_len;
> > +};
> [...]
> 
> How about putting data after the data_len and giving it a length of 0, so this is
> extensible to an arbitrary length key?
> 
> If we're extending the RSS configuration interface, there are a few other
> things that might be worth doing at the same time:
> 
> - Single commands to get/set both the key and the indirection table at the
> same time
> - Add a field to distinguish multiple RSS contexts (some hardware can use RSS
> contexts together with filters, though RX NFC does not support that yet)
Are you referring to the filter-id that is created at the time of config-nfc? Pls clarify.
> 
> Ben.
> 
> --
> Ben Hutchings
> friends: People who know you well, but like you anyway.

^ permalink raw reply

* Re: [Patch net-next 2/6] net_sched: act: export tcf_hash_search() instead of tcf_hash_lookup()
From: Jamal Hadi Salim @ 2014-01-20 12:28 UTC (permalink / raw)
  To: Cong Wang, netdev; +Cc: David S. Miller
In-Reply-To: <1389987427-14085-3-git-send-email-xiyou.wangcong@gmail.com>

On 01/17/14 14:37, Cong Wang wrote:
> So that we will not expose struct tcf_common to modules.
>
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
>


Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>


cheers,
jamal

^ permalink raw reply

* Re: [PATCH net-next 0/2] sctp: some small clean ups
From: Wang Weidong @ 2014-01-20 12:32 UTC (permalink / raw)
  To: Neil Horman, Daniel Borkmann; +Cc: davem, vyasevich, netdev, linux-sctp
In-Reply-To: <20140120122055.GA22690@hmsreliant.think-freely.org>

On 2014/1/20 20:20, Neil Horman wrote:
> On Mon, Jan 20, 2014 at 12:37:06PM +0100, Daniel Borkmann wrote:
>> On 01/20/2014 12:27 PM, Wang Weidong wrote:
>>> We have the macros in sctp.h, so use them for coding accordance
>>> in sctp.
>>
>> Thanks for doing this Wang.
>>
>> I am actually wondering why we have these macro locking wrappers
>> and not use these functions directly? Hm, any reasons? Maybe we
>> should rather go in the other direction with this?
>>
> Its because in the origional implementation of the sctp protocol, there was a
> user space test harness which built the kernel module for userspace execution to
> cary our some unit testing on the code.  It did so by redefining some of those
> locking macros to user space friendly code.  IIRC we haven't use those unit
> tests in years, and so should be removing them, not adding them to other
> locations.
> 

Thanks for your answers.

I will send the patches with removing these macros soon.

Regards,
Wang

> Neil
> 
>>> Wang Weidong (2):
>>>   sctp: use sctp_local_bh_{disable|enable} instead
>>>     local_bh_{disable|enable}
>>>   sctp: use sctp_read_[un]lock instead of read_[un]lock
>>>
>>>  net/sctp/endpointola.c   |  4 ++--
>>>  net/sctp/input.c         | 10 +++++-----
>>>  net/sctp/proc.c          | 12 ++++++------
>>>  net/sctp/sm_make_chunk.c |  8 ++++----
>>>  net/sctp/socket.c        |  8 ++++----
>>>  5 files changed, 21 insertions(+), 21 deletions(-)
>>>
>>
> 
> .
> 

^ permalink raw reply

* Re: [PATCH v5] can: add Renesas R-Car CAN driver
From: Marc Kleine-Budde @ 2014-01-20 12:35 UTC (permalink / raw)
  To: David Laight, 'Ben Dooks'
  Cc: Geert Uytterhoeven, Sergei Shtylyov, netdev@vger.kernel.org,
	wg@grandegger.com, linux-can@vger.kernel.org, Linux-sh list,
	vksavl@gmail.com
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D460082@AcuExch.aculab.com>

[-- Attachment #1: Type: text/plain, Size: 2265 bytes --]

On 01/20/2014 01:13 PM, David Laight wrote:
> From: 
>> On 20/01/14 11:58, Marc Kleine-Budde wrote:
>>> On 01/20/2014 12:52 PM, Geert Uytterhoeven wrote:
>>>> On Mon, Jan 20, 2014 at 12:47 PM, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
>>>>> On 01/20/2014 12:43 PM, Geert Uytterhoeven wrote:
>>>>>> On Thu, Dec 26, 2013 at 10:37 PM, Sergei Shtylyov
>>>>>> <sergei.shtylyov@cogentembedded.com> wrote:
>>>>>>> Changes in version 3:
>>>>>>
>>>>>>> - added '__packed' to 'struct rcar_can_mbox_regs' and 'struct rcar_can_regs';
>>>>>>> - removed unneeded type cast in the probe() method.
>>>>>>
>>>>>>> +/* Mailbox registers structure */
>>>>>>> +struct rcar_can_mbox_regs {
>>>>>>> +       u32 id;         /* IDE and RTR bits, SID and EID */
>>>>>>> +       u8 stub;        /* Not used */
>>>>>>> +       u8 dlc;         /* Data Length Code - bits [0..3] */
>>>>>>> +       u8 data[8];     /* Data Bytes */
>>>>>>> +       u8 tsh;         /* Time Stamp Higher Byte */
>>>>>>> +       u8 tsl;         /* Time Stamp Lower Byte */
>>>>>>> +} __packed;
>>>>>>
>>>>>> Sorry, I missed the earlier discussion, but why the _packed?
>>>>>> One u32 and 12 bytes makes a nice multiple of 4.
>>>>>
>>>>> Better safe than sorry, it's the layout of the registers in hardware,
>>>>> don't let the compiler optimize here.
> 
> Why not just add a compile time check against the size of the
> structure - that will ensure that no padding is accidentally added.

And what do when the check fails? Add an the __packed (again)? :D

>>>> Actually __packed makes it less safe, as the compiler now assumes
>>>> the u32 id member is unaligned, and thus may turn 32-bit accesses into 4
>>>> byte accesses.
>>>>
>>>> Fortunately it won't happen in this case as the code uses writel/readl to
>>>> acces the id member.
> 
> Which means that it will be aligned (and must be aligned).
> So the packed is completely useless and pointless.

Then we'll remove the packed.

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]

^ permalink raw reply

* Re: [Patch net-next 3/6] net_sched: act: hide struct tcf_common from API
From: Jamal Hadi Salim @ 2014-01-20 12:44 UTC (permalink / raw)
  To: Cong Wang, netdev; +Cc: David S. Miller
In-Reply-To: <1389987427-14085-4-git-send-email-xiyou.wangcong@gmail.com>

On 01/17/14 14:37, Cong Wang wrote:
> Now we can totally hide it from modules. tcf_hash_*() API's
> will operate on struct tc_action, modules don't need to care about
> the details.
>
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>


Looks good.
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>

^ permalink raw reply

* Re: [Patch net-next 3/6] net_sched: act: hide struct tcf_common from API
From: Jamal Hadi Salim @ 2014-01-20 13:01 UTC (permalink / raw)
  To: Cong Wang, netdev; +Cc: David S. Miller
In-Reply-To: <1389987427-14085-4-git-send-email-xiyou.wangcong@gmail.com>

On 01/17/14 14:37, Cong Wang wrote:
> Now we can totally hide it from modules. tcf_hash_*() API's
> will operate on struct tc_action, modules don't need to care about
> the details.
>
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Had to stare at this a bit longer - I am afraid
this and rest look a little suspect.
Can you run some tests for me after your patches?
I could do it in about 1 day if you dont have time.

---
#add a couple of tests
sudo tc actions add action drop index 10
sudo tc actions add action drop index 12
# now list them - should see both.
sudo tc actions ls action gact
#now flush them
sudo tc actions flush action gact
# now list them - should see them gone
sudo tc actions ls action gact
---

And for the last patch, in particular
---
#add two actions by index
sudo tc actions add action drop index 10
sudo tc actions add action ok index 12
# we need an ingress qdisc to attach filter to
sudo tc qdisc del dev lo parent ffff:
sudo tc qdisc add dev lo ingress
#use existing action index 10
sudo tc filter add dev lo parent ffff: protocol ip prio 8 \
u32 match ip dst 127.0.0.8/32 flowid 1:10 action gact index 10
#double bind
sudo tc filter add dev lo parent ffff: protocol ip prio 7 \
u32 match ip src 127.0.0.10/32 flowid 1:11 action gact index 10
# now lets see the filters..
sudo tc filter ls dev lo parent ffff: protocol ip
#display the actions and pay attention to the bind count
sudo tc actions ls action gact
#try to readd an existing action
sudo tc actions add action ok index 12
#it should be rejected - now list it and make sure refcnt doesnt go up
sudo tc actions ls action gact
#delete action index 12 (which is not bound)
sudo tc actions del action gact index 12
#list and make sure index 12 is gone
sudo tc actions ls action gact
#delete action index 10 (which is bound)
sudo tc actions del action gact index 10
#display to see it is still there ..
sudo tc actions ls action gact
#Repeat above two steps several times and make sure action 10 stays
# action should not be deleted...
#
# delete qdisc - which should delete all filters but not
# action that were not created by filters
sudo tc qdisc del dev lo parent ffff:
#ok now that filter is gone, lets see the actions ..
#pay attention to binds and references
sudo tc actions ls action gact
#
#delete action index 10 (which is no longer bound)
sudo tc actions del action gact index 10
#display to see it is gone
sudo tc actions ls action gact


cheers,
jamal

^ permalink raw reply

* RE: [PATCH net-next v2] xen-netback: Rework rx_work_todo
From: Paul Durrant @ 2014-01-20 13:02 UTC (permalink / raw)
  To: Zoltan Kiss, Ian Campbell, Wei Liu,
	xen-devel@lists.xenproject.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jonathan Davies
In-Reply-To: <52DD1540.7000503@citrix.com>

> -----Original Message-----
> From: Zoltan Kiss
> Sent: 20 January 2014 12:23
> To: Ian Campbell; Wei Liu; xen-devel@lists.xenproject.org;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Jonathan Davies
> Cc: Paul Durrant
> Subject: Re: [PATCH net-next v2] xen-netback: Rework rx_work_todo
> 
> Any reviews on this one? It fixes an important lockup situation, so
> either this or some other fix should go in soon.
> 
> On 15/01/14 17:11, Zoltan Kiss wrote:
> > The recent patch to fix receive side flow control (11b57f) solved the
> spinning
> > thread problem, however caused an another one. The receive side can
> stall, if:
> > - [THREAD] xenvif_rx_action sets rx_queue_stopped to true
> > - [INTERRUPT] interrupt happens, and sets rx_event to true
> > - [THREAD] then xenvif_kthread sets rx_event to false
> > - [THREAD] rx_work_todo doesn't return true anymore
> >
> > Also, if interrupt sent but there is still no room in the ring, it take quite a
> > long time until xenvif_rx_action realize it. This patch ditch that two variable,
> > and rework rx_work_todo. If the thread finds it can't fit more skb's into the
> > ring, it saves the last slot estimation into rx_last_skb_slots, otherwise it's
> > kept as 0. Then rx_work_todo will check if:
> > - there is something to send to the ring (like before)
> > - there is space for the topmost packet in the queue
> >
> > I think that's more natural and optimal thing to test than two bool which are
> > set somewhere else.
> >
> > Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
> > ---
> >   drivers/net/xen-netback/common.h    |    6 +-----
> >   drivers/net/xen-netback/interface.c |    1 -
> >   drivers/net/xen-netback/netback.c   |   16 ++++++----------
> >   3 files changed, 7 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-
> netback/common.h
> > index 4c76bcb..ae413a2 100644
> > --- a/drivers/net/xen-netback/common.h
> > +++ b/drivers/net/xen-netback/common.h
> > @@ -143,11 +143,7 @@ struct xenvif {
> >   	char rx_irq_name[IFNAMSIZ+4]; /* DEVNAME-rx */
> >   	struct xen_netif_rx_back_ring rx;
> >   	struct sk_buff_head rx_queue;
> > -	bool rx_queue_stopped;
> > -	/* Set when the RX interrupt is triggered by the frontend.
> > -	 * The worker thread may need to wake the queue.
> > -	 */
> > -	bool rx_event;
> > +	RING_IDX rx_last_skb_slots;
> >
> >   	/* This array is allocated seperately as it is large */
> >   	struct gnttab_copy *grant_copy_op;
> > diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-
> netback/interface.c
> > index b9de31e..7669d49 100644
> > --- a/drivers/net/xen-netback/interface.c
> > +++ b/drivers/net/xen-netback/interface.c
> > @@ -100,7 +100,6 @@ static irqreturn_t xenvif_rx_interrupt(int irq, void
> *dev_id)
> >   {
> >   	struct xenvif *vif = dev_id;
> >
> > -	vif->rx_event = true;
> >   	xenvif_kick_thread(vif);
> >
> >   	return IRQ_HANDLED;
> > diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-
> netback/netback.c
> > index 2738563..bb241d0 100644
> > --- a/drivers/net/xen-netback/netback.c
> > +++ b/drivers/net/xen-netback/netback.c
> > @@ -477,7 +477,6 @@ static void xenvif_rx_action(struct xenvif *vif)
> >   	unsigned long offset;
> >   	struct skb_cb_overlay *sco;
> >   	bool need_to_notify = false;
> > -	bool ring_full = false;
> >
> >   	struct netrx_pending_operations npo = {
> >   		.copy  = vif->grant_copy_op,
> > @@ -487,7 +486,7 @@ static void xenvif_rx_action(struct xenvif *vif)
> >   	skb_queue_head_init(&rxq);
> >
> >   	while ((skb = skb_dequeue(&vif->rx_queue)) != NULL) {
> > -		int max_slots_needed;
> > +		RING_IDX max_slots_needed;
> >   		int i;
> >
> >   		/* We need a cheap worse case estimate for the number of
> > @@ -510,9 +509,10 @@ static void xenvif_rx_action(struct xenvif *vif)
> >   		if (!xenvif_rx_ring_slots_available(vif, max_slots_needed)) {
> >   			skb_queue_head(&vif->rx_queue, skb);
> >   			need_to_notify = true;
> > -			ring_full = true;
> > +			vif->rx_last_skb_slots = max_slots_needed;
> >   			break;
> > -		}
> > +		} else
> > +			vif->rx_last_skb_slots = 0;
> >
> >   		sco = (struct skb_cb_overlay *)skb->cb;
> >   		sco->meta_slots_used = xenvif_gop_skb(skb, &npo);
> > @@ -523,8 +523,6 @@ static void xenvif_rx_action(struct xenvif *vif)
> >
> >   	BUG_ON(npo.meta_prod > ARRAY_SIZE(vif->meta));
> >
> > -	vif->rx_queue_stopped = !npo.copy_prod && ring_full;
> > -
> >   	if (!npo.copy_prod)
> >   		goto done;
> >
> > @@ -1727,8 +1725,8 @@ static struct xen_netif_rx_response
> *make_rx_response(struct xenvif *vif,
> >
> >   static inline int rx_work_todo(struct xenvif *vif)
> >   {
> > -	return (!skb_queue_empty(&vif->rx_queue) && !vif-
> >rx_queue_stopped) ||
> > -		vif->rx_event;
> > +	return !skb_queue_empty(&vif->rx_queue) &&
> > +	       xenvif_rx_ring_slots_available(vif, vif->rx_last_skb_slots);
> >   }
> >
> >   static inline int tx_work_todo(struct xenvif *vif)
> > @@ -1814,8 +1812,6 @@ int xenvif_kthread(void *data)
> >   		if (!skb_queue_empty(&vif->rx_queue))
> >   			xenvif_rx_action(vif);
> >
> > -		vif->rx_event = false;
> > -

The minimal patch is to simply move this line up above the previous if clause, but I'm happy with your patch as it stands so

Reviewed-by: Paul Durrant <paul.durrant@citrix.com>

> >   		if (skb_queue_empty(&vif->rx_queue) &&
> >   		    netif_queue_stopped(vif->dev))
> >   			xenvif_start_queue(vif);
> >

^ permalink raw reply

* [ANNOUNCE]: Release of nftables 0.099
From: Patrick McHardy @ 2014-01-20 13:11 UTC (permalink / raw)
  To: netfilter-devel; +Cc: netfilter, announce, netdev, coreteam

[-- Attachment #1: Type: text/plain, Size: 6730 bytes --]

The Netfilter project presents:

        nftables 0.099

With the release of Linux 3.13 and almost 5 years after the last nftables
release, the time has come to finally get this code out to our users.

Since this is the first regular release intended for users, I'm including
a bit of extra information.

Overview
========

nf_tables is the new firewalling infrastructure in the Linux kernel,
intended to replace ip_tables, ip6_tables, arp_tables and ebtables
in the long term. nftables is the corresponsing userspace frontend,
replacing their respective userspace utilities.

nftables features native support for sets and dictionaries of arbitrary
types, support for many different protocols, meta data types, connection
tracking, NAT, logging, atomic incremental and full ruleset updates,
a netlink API with notification support, a format grammar, a compatiblity
layer for iptables/ip6tables and more.

While the internal architecture is fundamentally different from
ip_tables etc, many of the well proven concepts like tables and chains
have been retained. The syntax differs significantly from iptables
and friends, most notable, the options style parsing has been replaced
by a formal grammar and a set of keywords. For anyone familiar with
BPF the syntax should be quite easy to learn.

Architecture
============

As mentioned previously, the architecture differs significantly from
the existing packet filtering mechanisms. While ip_tables etc. include
special modules for each and every protocol they support, for each meta
data type etc and each each of these modules implement a set of usually
similar operations on this data, nftables contains a small evaluation
engine (sometimes called a virtual machine) with extensions to support
getting packet payload data, meta data, ... and performing operations
with this data, altering flow control and so on.

The userspace frontend performs parsing of the ruleset and compiles it
into instructions for the virtual machine. F.i. while an iptables tcp
dport match would instruct the xt_tcpudp module to compare the TCP port
number, nftables userspace emits instructions to load 2 bytes at the
position network header + 2 into a so called register and a second
instruction to compare that register to a given value. IOW, the kernel
doesn't require knowledge of particular protocols, support for them
can in most cases be added completely in the nftables frontend.

Data gathered from the packet (or elsewhere) can not only be used for
matches (called relational expressions in nftables), but for dynamically
parameterizing other extensions. F.i. the following expression would
select the DNAT destination address based on the source address of the
packet:

... dnat ip saddr map {
	192.168.0.0/24 : 10.0.0.1,
	192.168.1.0/24 : 10.0.0.2,
	* : 10.0.0.3 
    }

while the following expression would store the input interface index
in the upper 8 bits of the packet mark to be used in the POSTROUTING 
hook where it is not available anymore:

... mark set iif

Similar to ip_tables, rules are organized in address family specific
tables and chains. The kernel doesn't include any pre-defined tables
anymore, they can be created at will from userspace. Special features
of tables like the NAT table and mangle table are available as so
called "chain types", which instruct nftables to perform operations
like setting up NAT mappings or rerouting packets after remarking.
A set of predefined tables corresponding to the tables existing in
ip_tables etc is contained in nftables.

Dictionaries, as shown in the previous dnat example, can not only
be used for parameterizing different extensions, but also to alter
control flow, allowing to build match trees with efficient branching:

... iif vmap {
	eth0 : jump from_lan,
	eth1 : jump from_dmz,
	eth2 : jump from_wan,
	*    : drop,
    }

Status
======

There are still a few rough edges, but we believe the code is ready
to be used for testing and personal usage. It is not ready for
production use, but we should be getting there quickly. Userspace
may occasionally produce an unexpected error for uncommon cases,
the kernel side is expected to be pretty much solid. Any bugs
reported will be fixed quickly.

While trying to avoid it when possible, until the 0.1 release we may
still change the grammar or other things in incompatible ways. This
should result in only small impact though, most of the grammar is
expected to stay as it is.

Naming
======

nftables releases have names. The last release v0.01-alpha1 was named
schäublefilter, honoring the minister of the interieur of Germany,
Wolfgang Schäuble, and his attempts to introduce legislation to allow
the state to crack computers.

Owing to the fact that his term is over since over four years and that
in retrospective his attempts really seem only alpha, the new release
is named keith-alexander-filter, in celebration of not being backdoored
by the NSA so far.

Resources
=========

The nftables code can be obtained from:

* http://netfilter.org/projects/nftables/downloads.html
* ftp://ftp.netfilter.org/pub/nftables
* git://git.netfilter.org/nftables

To build the code, you libnftnl and libmnl are required:

* http://netfilter.org/projects/libnftnl/index.html
* http://netfilter.org/projects/libmnl/index.html

The iptables compatibility layer is available at:

* git://git.netfilter.org/iptables-nftables

The code should appear on the website and FTP shortly.

Further reading
===============

While documentation is still scarce at the moment, the next release
will include a full command reference and further documentation.

The project page on netfilter.org contains some further pointers:

  http://netfilter.org/projects/nftables/index.html

Eric Leblond has written a short howto:

  https://home.regit.org/netfilter-en/nftables-quick-howto/

and has given a presentation on nftables:

  https://home.regit.org/wp-content/uploads/2013/09/2013_kernel_recipes_nftables.pdf

My first presentation on nftables during NFWS 2008 in Paris:

  http://people.netfilter.org/kaber/nfws2008/nftables.odp

And there's a Wiki-page with some further information on the basic
building blocks, the syntax ...:

  http://people.netfilter.org/wiki-nftables/index.php/Main_Page

Thanks
======

A lot of people have started contributing to nftables during the past
1.5 years and helped to get both the kernel and userspace components in
shape for merging and release. Pablo revived the project after I stopped
working on it for quite a while, Eric Leblond, Tomasz Burstyka, Arturo 
Borrero, Alvaro Neira and Giuseppe Longo all made important contributions
to nftables and the surrounding infrastructure.


On behalf of the Netfilter Core Team,
Happy bytecode execution :)



[-- Attachment #2: changes.txt --]
[-- Type: text/plain, Size: 11351 bytes --]

Ana Rey (1):
      nft: scanner: fixed problem with ipv6 address

Arturo Borrero (2):
      nftables: delete debian/ directory
      mnl: fix inconsistent name usage in nft_*_nlmsg_build_hdr calls

Arturo Borrero Gonzalez (2):
      src: fix return code
      files: replace interpreter during installation

Eric Leblond (23):
      rule: add flag to display rule handle as comment
      doc: fix inversion of operator and object.
      rule: list elements in set in any case
      cli: add quit command
      cli: reset terminal when CTRL+d is pressed
      rule: display hook info
      src: fix counter restoration
      src: Add support for insertion inside rule list
      src: Add icmpv6 support
      nat: add mandatory family attribute
      Suppress non working examples.
      Update chain creation format.
      display family in table listing
      netlink: fix IPv6 prefix computation
      src: Add support for IPv6 NAT
      mnl: fix typo in comment
      netlink: suppress useless variable
      netlink: only flush asked table/chain
      netlink: fix nft flush operation
      expression: fix indent
      jump: fix logic in netlink linearize
      verdict: fix delinearize in case of jump
      netlink: only display wanted chain in listing

Florian Westphal (3):
      log: s/threshold/queue-threshold/
      meta: iif/oifname should be host byte order
      statement: avoid huge rodata array

Kevin Fenzi (1):
      nftables: drop hard coded install using root user owner and group

Pablo Neira (1):
      expression: fix output of verdict maps

Pablo Neira Ayuso (63):
      tests: fix test, commands now comes before the family and table name
      rule: allow to list of existing tables
      rule: fix nft list chain
      netlink: return error if chain not found
      main: fix error checking in nft_parse
      tests: family-ipv4: update test to use current syntax
      tests: expr-ct: update examples to use the current syntax
      src: fix crash if nft -f wrong_file is passed
      tests: family-ipv6: update to use the current syntax
      payload: accept ethertype in hexadecimal
      tests: family-bridge: update to use the current syntax
      tests: feat-adjancent-load-merging: remove ip protocol from rule
      meta: accept uid/gid in numerical
      tests: expr-meta: update examples to use the current syntax
      tests: obj-chain: update examples to use the current syntax
      tests: dictionary: update examples to use the current syntax
      tests: set: update examples to use the current syntax
      tests: obj-table: update examples to use the current syntax
      cli: complete basic functionality of the interactive mode
      datatype: concat expression only releases dynamically allocated datatype
      evaluate: fix range and comparison evaluation
      src: get it sync with current include/linux/netfilter/nf_tables.h
      rule: family field in struct handle is unsigned
      meta: use if_nametoindex and if_indextoname
      meta: replace rtnl_tc_handle2str and rtnl_tc_str2handle
      src: use libnftables
      netlink: fix network address prefix
      datatype: fix table listing if name resolution is not available
      mnl: use nft_*_list_add_tail
      datatype: fix crash if wrong integer type is passed
      log: convert group and qthreshold to use u16
      datatype: fix wrong endianess in numeric ports
      src: allow to specify the base chain type
      meta: fix output display of meta length
      datatype: fix mark parsing if string is used
      payload: fix endianess of ARP operation code
      netlink: use uint32_t instead of size_t for attribute length
      src: add rule batching support
      netlink_linearize: finish reject support
      payload: fix ethernet type protocol matching
      parser: fix warning on deprecated directive in bison
      build: relax compilation not to break on warning
      datatype: fix missing nul-terminated string in string_type_print
      netlink: improve rule deletion per chain
      meta: fix endianness in UID/GID
      meta: relax restriction on UID/GID parsing
      src: fix rule flushing atomically
      mnl: don't set NLM_F_ACK flag in mnl_nft_rule_batch_[add|del]
      mnl: print netlink message if if --debug=netlink in mnl_talk()
      netlink: fix dictionary feature with data mappings
      netlink: fix wrong type in attributes
      scanner: rename address selector from 'eth' to 'ether'
      scanner: add aliases to symbols for easier interaction with most shells
      segtree: add new segtree debugging option
      netlink: use stdout for debugging
      parser: fix parsing of ethernet protocol types
      payload: fix crash when wrong ethernet protocol type is used
      payload: fix inconsistency in ethertype output
      src: add new --debug=mnl option to enable libmnl debugging
      src: use ':' instead of '=>' in dictionaries
      datatype: add time type parser and adapt output
      mnl: fix chain type autoloading
      use new libnftnl library name

Patrick McHardy (96):
      build: work around docbook2x-man inability to specify output file
      templates: add IPv6 raw table template
      netlink: wrap libnl object dumping in #ifdef DEBUG
      lexer: fix some whitespace errors
      Fix use of reserved names in header sandwich
      kill obsolete TODO item
      Allow newlines in sets and maps
      Allow newlines in regular maps
      build: remove double subdir in build output
      build: fix installation when docs are not built
      Add installation instructions
      parser: fix common_block usage in chain and table blocks
      parser: consistently use $@ for location of entire grouping
      Add support for scoping and symbol binding
      Add support for user-defined symbolic constants
      Add more notes to INSTALL
      expr: add support for cloning expressions
      Fix multiple references to the same user defined symbolic expression
      Release scopes during cleanup
      Fix some memory leaks
      netlink_linearize: remove two debugging printfs
      ct: resync netlink header and properly add ct l3protocol support
      netlink: add helper function for socket callback modification
      netlink: consistent naming fixes
      netlink: use libnl OBJ_CAST macro
      netlink: move data related functions to netlink.c
      datatype: maintain table of all datatypes and add registration/lookup function
      datatype: add/move size and byte order information into data types
      expressions: kill seperate sym_type datatype for symbols
      add support for new set API and standalone sets
      debug: allow runtime control of debugging output
      netlink: fix bitmask element reconstruction
      netlink: dump all chains when listing rules
      netlink: fix binop RHS byteorder
      payload: add DCCP packet type definitions
      payload: fix two datatypes
      parser: support bison >= 2.4
      build: add 'archive' target
      build: fix endless recursion with SUBDIRS=...
      debug: properly parse debug levels
      netlink: fix byteorder of RHS of relational meta expression
      utils: fix invalid assertion in xrealloc()
      netlink: fix creation of base chains with hooknum and priority 0
      payload: fix crash with uncombinable protocols
      netlink: fix nat stmt linearization/parsing
      nat: validate protocol context when performing transport protocol mappings
      netlink: add debugging for missing objects
      don't use internal_location for files specified on command line
      datatype: reject incompletely parsed integers in integer_type_parse()
      add bridge filter table definitions
      parser: fix parsing protocol names for protocols which are also keywords
      evaluate: reintroduce type chekcs for relational expressions
      segtree: fix segtree to properly support mappings
      tests: add verdict map test
      seqtree: update mapping data when keeping the base
      payload: kill redundant payload protocol expressions during netlink postprocessing
      expression: fix constant expression splicing
      rules: change rule handle to 64 bit
      netlink: fix endless loop on 64 bit when parsing binops
      sets: fix sets using intervals
      rule: reenable adjacent payload merging
      cmd: fix handle use after free for implicit set declarations
      tests: add loop detection tests
      netlink: fix query requests
      chains: add chain rename support
      rule: add rule insertion (prepend) support
      chains: add rename testcases
      netlink_delinearize: don't reset source register after read
      expr: kill EXPR_F_PRIMARY
      datatype: parse/print in all basetypes subsequently
      types: add ethernet address type
      expr: fix concat expression type propagation
      cmd/netlink: make sure we always have a location in netlink operations
      mark: fix numeric mark value parsing
      expr: catch missing and excess elements in concatenations
      parser: include leading '.' in concat subexpression location
      parser: fix size of internet protocol expressions matching keywords
      nftables: fix supression of "permission denied" errors
      nftables: shorten "could not process rule in batch" message
      erec: fix error markup for errors starting at column 0
      datatype: revert "fix crash if wrong integer type is passed"
      meta: fix crash when parsing unresolvable mark values
      parser: replace "vmap" keyword by "map"
      Revert "parser: replace "vmap" keyword by "map""
      expr: remove secmark from ct and meta expression
      meta: don't require "meta" keyword for a subset of meta expressions
      meta: fix mismerge
      payload: fix name of eth_proto
      expr: relational: don't surpress '==' for LHS binops in output
      parser: fix compilation breakage
      segtree: only use prefix expressions for ranges for selected datatypes
      segtree: fix decomposition of unclosed intervals
      build: fix recursive parser.h inclusion
      set: make set flags output parsable
      set: make set initializer parsable
      nftables: version 0.099

Phil Oester (8):
      datatype: validate port number in inet_service_type_parse
      datatype: allow protocols by number in inet_protocol_type_parse
      nftables: add additional --numeric level
      src: operational limit match
      parser: segfault in top scope define
      examples: adjust new chain type syntax in sets_and_maps file
      rule: missing set cleanup in do_command_list
      parser: add 'delete map' syntax

Romain Bignon (1):
      help: fix of the -I option in help display

Tomasz Bursztyka (11):
      netlink: Use the right datatype for verdict
      evaluate: Remove useless variable in expr_evaluate_bitwise()
      erec: Handle returned value properly in erec_print
      expression: Differentiate expr among anonymous structures in struct expr
      src: Fix base chain printing
      INSTALL: Update dependency list and repository URLs
      src: Wrap netfilter hooks around human readable strings
      src: Add priority keyword on base chain description
      tests: Update bate chain creation according to latest syntax changes
      src: Better error reporting if chain type is invalid
      include: cache a copy of nfnetlink.h

root (1):
      debug: include verbose message in all BUG statements


^ permalink raw reply


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