Netdev List
 help / color / mirror / Atom feed
* [PATCH 5/8] xfrm: Auto-load xfrm offload modules
From: Steffen Klassert @ 2017-08-21  5:49 UTC (permalink / raw)
  To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev
In-Reply-To: <1503294573-10206-1-git-send-email-steffen.klassert@secunet.com>

From: Ilan Tayari <ilant@mellanox.com>

IPSec crypto offload depends on the protocol-specific
offload module (such as esp_offload.ko).

When the user installs an SA with crypto-offload, load
the offload module automatically, in the same way
that the protocol module is loaded (such as esp.ko)

Signed-off-by: Ilan Tayari <ilant@mellanox.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 include/net/xfrm.h      |  4 +++-
 net/ipv4/esp4_offload.c |  1 +
 net/ipv6/esp6_offload.c |  1 +
 net/xfrm/xfrm_device.c  |  2 +-
 net/xfrm/xfrm_state.c   | 16 ++++++++++++----
 net/xfrm/xfrm_user.c    |  2 +-
 6 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index afb4929..5a36010 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -43,6 +43,8 @@
 	MODULE_ALIAS("xfrm-mode-" __stringify(family) "-" __stringify(encap))
 #define MODULE_ALIAS_XFRM_TYPE(family, proto) \
 	MODULE_ALIAS("xfrm-type-" __stringify(family) "-" __stringify(proto))
+#define MODULE_ALIAS_XFRM_OFFLOAD_TYPE(family, proto) \
+	MODULE_ALIAS("xfrm-offload-" __stringify(family) "-" __stringify(proto))
 
 #ifdef CONFIG_XFRM_STATISTICS
 #define XFRM_INC_STATS(net, field)	SNMP_INC_STATS((net)->mib.xfrm_statistics, field)
@@ -1558,7 +1560,7 @@ void xfrm_spd_getinfo(struct net *net, struct xfrmk_spdinfo *si);
 u32 xfrm_replay_seqhi(struct xfrm_state *x, __be32 net_seq);
 int xfrm_init_replay(struct xfrm_state *x);
 int xfrm_state_mtu(struct xfrm_state *x, int mtu);
-int __xfrm_init_state(struct xfrm_state *x, bool init_replay);
+int __xfrm_init_state(struct xfrm_state *x, bool init_replay, bool offload);
 int xfrm_init_state(struct xfrm_state *x);
 int xfrm_prepare_input(struct xfrm_state *x, struct sk_buff *skb);
 int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type);
diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c
index 05831de..aca1c85 100644
--- a/net/ipv4/esp4_offload.c
+++ b/net/ipv4/esp4_offload.c
@@ -305,3 +305,4 @@ module_init(esp4_offload_init);
 module_exit(esp4_offload_exit);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Steffen Klassert <steffen.klassert@secunet.com>");
+MODULE_ALIAS_XFRM_OFFLOAD_TYPE(AF_INET, XFRM_PROTO_ESP);
diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
index eec3add..8d4e2ba 100644
--- a/net/ipv6/esp6_offload.c
+++ b/net/ipv6/esp6_offload.c
@@ -334,3 +334,4 @@ module_init(esp6_offload_init);
 module_exit(esp6_offload_exit);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Steffen Klassert <steffen.klassert@secunet.com>");
+MODULE_ALIAS_XFRM_OFFLOAD_TYPE(AF_INET6, XFRM_PROTO_ESP);
diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
index 5cd7a24..1904127 100644
--- a/net/xfrm/xfrm_device.c
+++ b/net/xfrm/xfrm_device.c
@@ -63,7 +63,7 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
 	xfrm_address_t *daddr;
 
 	if (!x->type_offload)
-		return 0;
+		return -EINVAL;
 
 	/* We don't yet support UDP encapsulation, TFC padding and ESN. */
 	if (x->encap || x->tfcpad || (x->props.flags & XFRM_STATE_ESN))
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 82cbbce..a41e2ef 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -296,12 +296,14 @@ int xfrm_unregister_type_offload(const struct xfrm_type_offload *type,
 }
 EXPORT_SYMBOL(xfrm_unregister_type_offload);
 
-static const struct xfrm_type_offload *xfrm_get_type_offload(u8 proto, unsigned short family)
+static const struct xfrm_type_offload *
+xfrm_get_type_offload(u8 proto, unsigned short family, bool try_load)
 {
 	struct xfrm_state_afinfo *afinfo;
 	const struct xfrm_type_offload **typemap;
 	const struct xfrm_type_offload *type;
 
+retry:
 	afinfo = xfrm_state_get_afinfo(family);
 	if (unlikely(afinfo == NULL))
 		return NULL;
@@ -311,6 +313,12 @@ static const struct xfrm_type_offload *xfrm_get_type_offload(u8 proto, unsigned
 	if ((type && !try_module_get(type->owner)))
 		type = NULL;
 
+	if (!type && try_load) {
+		request_module("xfrm-offload-%d-%d", family, proto);
+		try_load = 0;
+		goto retry;
+	}
+
 	rcu_read_unlock();
 	return type;
 }
@@ -2165,7 +2173,7 @@ int xfrm_state_mtu(struct xfrm_state *x, int mtu)
 	return mtu - x->props.header_len;
 }
 
-int __xfrm_init_state(struct xfrm_state *x, bool init_replay)
+int __xfrm_init_state(struct xfrm_state *x, bool init_replay, bool offload)
 {
 	struct xfrm_state_afinfo *afinfo;
 	struct xfrm_mode *inner_mode;
@@ -2230,7 +2238,7 @@ int __xfrm_init_state(struct xfrm_state *x, bool init_replay)
 	if (x->type == NULL)
 		goto error;
 
-	x->type_offload = xfrm_get_type_offload(x->id.proto, family);
+	x->type_offload = xfrm_get_type_offload(x->id.proto, family, offload);
 
 	err = x->type->init_state(x);
 	if (err)
@@ -2258,7 +2266,7 @@ EXPORT_SYMBOL(__xfrm_init_state);
 
 int xfrm_init_state(struct xfrm_state *x)
 {
-	return __xfrm_init_state(x, true);
+	return __xfrm_init_state(x, true, false);
 }
 
 EXPORT_SYMBOL(xfrm_init_state);
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 1b539b7..ffe8d5e 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -584,7 +584,7 @@ static struct xfrm_state *xfrm_state_construct(struct net *net,
 
 	xfrm_mark_get(attrs, &x->mark);
 
-	err = __xfrm_init_state(x, false);
+	err = __xfrm_init_state(x, false, attrs[XFRMA_OFFLOAD_DEV]);
 	if (err)
 		goto error;
 
-- 
2.7.4

^ permalink raw reply related

* [PATCH 6/8] xfrm: Clear RX SKB secpath xfrm_offload
From: Steffen Klassert @ 2017-08-21  5:49 UTC (permalink / raw)
  To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev
In-Reply-To: <1503294573-10206-1-git-send-email-steffen.klassert@secunet.com>

From: Ilan Tayari <ilant@mellanox.com>

If an incoming packet undergoes XFRM crypto-offload, its secpath is
filled with xfrm_offload struct denoting offload information.

If the SKB is then forwarded to a device which supports crypto-
offload, the stack wrongfully attempts to offload it (even though
the output SA may not exist on the device) due to the leftover
secpath xo.

Clear the ingress xo by zeroizing secpath->olen just before
delivering the decapsulated packet to the network stack.

Fixes: d77e38e612a0 ("xfrm: Add an IPsec hardware offloading API")
Signed-off-by: Ilan Tayari <ilant@mellanox.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/xfrm/xfrm_input.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index 923205e..f07eec5 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -424,6 +424,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
 	nf_reset(skb);
 
 	if (decaps) {
+		skb->sp->olen = 0;
 		skb_dst_drop(skb);
 		gro_cells_receive(&gro_cells, skb);
 		return 0;
@@ -434,6 +435,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
 
 		err = x->inner_mode->afinfo->transport_finish(skb, xfrm_gro || async);
 		if (xfrm_gro) {
+			skb->sp->olen = 0;
 			skb_dst_drop(skb);
 			gro_cells_receive(&gro_cells, skb);
 			return err;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 7/8] net: Allow IPsec GSO for local sockets
From: Steffen Klassert @ 2017-08-21  5:49 UTC (permalink / raw)
  To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev
In-Reply-To: <1503294573-10206-1-git-send-email-steffen.klassert@secunet.com>

This patch allows local sockets to make use of XFRM GSO code path.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Ilan Tayari <ilant@mellanox.com>
---
 include/net/xfrm.h | 19 +++++++++++++++++++
 net/core/sock.c    |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 5a36010..18d7de3 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1858,6 +1858,20 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
 		       struct xfrm_user_offload *xuo);
 bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x);
 
+static inline bool xfrm_dst_offload_ok(struct dst_entry *dst)
+{
+	struct xfrm_state *x = dst->xfrm;
+
+	if (!x || !x->type_offload)
+		return false;
+
+	if (x->xso.offload_handle && (x->xso.dev == dst->path->dev) &&
+	    !dst->child->xfrm)
+		return true;
+
+	return false;
+}
+
 static inline void xfrm_dev_state_delete(struct xfrm_state *x)
 {
 	struct xfrm_state_offload *xso = &x->xso;
@@ -1900,6 +1914,11 @@ static inline bool xfrm_dev_offload_ok(struct sk_buff *skb, struct xfrm_state *x
 {
 	return false;
 }
+
+static inline bool xfrm_dst_offload_ok(struct dst_entry *dst)
+{
+	return false;
+}
 #endif
 
 static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_mark *m)
diff --git a/net/core/sock.c b/net/core/sock.c
index 742f68c..564f835 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1757,7 +1757,7 @@ void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
 		sk->sk_route_caps |= NETIF_F_GSO_SOFTWARE;
 	sk->sk_route_caps &= ~sk->sk_route_nocaps;
 	if (sk_can_gso(sk)) {
-		if (dst->header_len) {
+		if (dst->header_len && !xfrm_dst_offload_ok(dst)) {
 			sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
 		} else {
 			sk->sk_route_caps |= NETIF_F_SG | NETIF_F_HW_CSUM;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 4/8] esp6: Fix RX checksum after header pull
From: Steffen Klassert @ 2017-08-21  5:49 UTC (permalink / raw)
  To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev
In-Reply-To: <1503294573-10206-1-git-send-email-steffen.klassert@secunet.com>

From: Yossi Kuperman <yossiku@mellanox.com>

Both ip6_input_finish (non-GRO) and esp6_gro_receive (GRO) strip
the IPv6 header without adjusting skb->csum accordingly. As a
result CHECKSUM_COMPLETE breaks and "hw csum failure" is written
to the kernel log by netdev_rx_csum_fault (dev.c).

Fix skb->csum by substracting the checksum value of the pulled IPv6
header using a call to skb_postpull_rcsum.

This affects both transport and tunnel modes.

Note that the fix occurs far from the place that the header was
pulled. This is based on existing code, see:
ipv6_srh_rcv() in exthdrs.c and rawv6_rcv() in raw.c

Signed-off-by: Yossi Kuperman <yossiku@mellanox.com>
Signed-off-by: Ilan Tayari <ilant@mellanox.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv6/esp6.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 0ca1db6..74bde20 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -495,6 +495,8 @@ int esp6_input_done2(struct sk_buff *skb, int err)
 
 	trimlen = alen + padlen + 2;
 	if (skb->ip_summed == CHECKSUM_COMPLETE) {
+		skb_postpull_rcsum(skb, skb_network_header(skb),
+				   skb_network_header_len(skb));
 		csumdiff = skb_checksum(skb, skb->len - trimlen, trimlen, 0);
 		skb->csum = csum_block_sub(skb->csum, csumdiff,
 					   skb->len - trimlen);
-- 
2.7.4

^ permalink raw reply related

* [PATCH 1/8] esp4: Support RX checksum with crypto offload
From: Steffen Klassert @ 2017-08-21  5:49 UTC (permalink / raw)
  To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev
In-Reply-To: <1503294573-10206-1-git-send-email-steffen.klassert@secunet.com>

From: Ilan Tayari <ilant@mellanox.com>

Keep the device's reported ip_summed indication in case crypto
was offloaded by the device. Subtract the csum values of the
stripped parts (esp header+iv, esp trailer+auth_data) to keep
value correct.

Note: CHECKSUM_COMPLETE should be indicated only if skb->csum
has the post-decryption offload csum value.

Signed-off-by: Ariel Levkovich <lariel@mellanox.com>
Signed-off-by: Ilan Tayari <ilant@mellanox.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv4/esp4.c         | 14 +++++++++++---
 net/ipv4/esp4_offload.c |  4 +++-
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
index 0cbee0a..741acd7 100644
--- a/net/ipv4/esp4.c
+++ b/net/ipv4/esp4.c
@@ -510,7 +510,8 @@ int esp_input_done2(struct sk_buff *skb, int err)
 	int elen = skb->len - hlen;
 	int ihl;
 	u8 nexthdr[2];
-	int padlen;
+	int padlen, trimlen;
+	__wsum csumdiff;
 
 	if (!xo || (xo && !(xo->flags & CRYPTO_DONE)))
 		kfree(ESP_SKB_CB(skb)->tmp);
@@ -568,8 +569,15 @@ int esp_input_done2(struct sk_buff *skb, int err)
 			skb->ip_summed = CHECKSUM_UNNECESSARY;
 	}
 
-	pskb_trim(skb, skb->len - alen - padlen - 2);
-	__skb_pull(skb, hlen);
+	trimlen = alen + padlen + 2;
+	if (skb->ip_summed == CHECKSUM_COMPLETE) {
+		csumdiff = skb_checksum(skb, skb->len - trimlen, trimlen, 0);
+		skb->csum = csum_block_sub(skb->csum, csumdiff,
+					   skb->len - trimlen);
+	}
+	pskb_trim(skb, skb->len - trimlen);
+
+	skb_pull_rcsum(skb, hlen);
 	if (x->props.mode == XFRM_MODE_TUNNEL)
 		skb_reset_transport_header(skb);
 	else
diff --git a/net/ipv4/esp4_offload.c b/net/ipv4/esp4_offload.c
index e066601..05831de 100644
--- a/net/ipv4/esp4_offload.c
+++ b/net/ipv4/esp4_offload.c
@@ -182,11 +182,13 @@ static struct sk_buff *esp4_gso_segment(struct sk_buff *skb,
 static int esp_input_tail(struct xfrm_state *x, struct sk_buff *skb)
 {
 	struct crypto_aead *aead = x->data;
+	struct xfrm_offload *xo = xfrm_offload(skb);
 
 	if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead)))
 		return -EINVAL;
 
-	skb->ip_summed = CHECKSUM_NONE;
+	if (!(xo->flags & CRYPTO_DONE))
+		skb->ip_summed = CHECKSUM_NONE;
 
 	return esp_input_done2(skb, 0);
 }
-- 
2.7.4

^ permalink raw reply related

* [PATCH 2/8] esp6: Support RX checksum with crypto offload
From: Steffen Klassert @ 2017-08-21  5:49 UTC (permalink / raw)
  To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev
In-Reply-To: <1503294573-10206-1-git-send-email-steffen.klassert@secunet.com>

From: Ilan Tayari <ilant@mellanox.com>

Keep the device's reported ip_summed indication in case crypto
was offloaded by the device. Subtract the csum values of the
stripped parts (esp header+iv, esp trailer+auth_data) to keep
value correct.

Note: CHECKSUM_COMPLETE should be indicated only if skb->csum
has the post-decryption offload csum value.

Signed-off-by: Ariel Levkovich <lariel@mellanox.com>
Signed-off-by: Ilan Tayari <ilant@mellanox.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv6/esp6.c         | 14 +++++++++++---
 net/ipv6/esp6_offload.c |  4 +++-
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index 9ed3547..0ca1db6 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -470,7 +470,8 @@ int esp6_input_done2(struct sk_buff *skb, int err)
 	int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead);
 	int elen = skb->len - hlen;
 	int hdr_len = skb_network_header_len(skb);
-	int padlen;
+	int padlen, trimlen;
+	__wsum csumdiff;
 	u8 nexthdr[2];
 
 	if (!xo || (xo && !(xo->flags & CRYPTO_DONE)))
@@ -492,8 +493,15 @@ int esp6_input_done2(struct sk_buff *skb, int err)
 
 	/* ... check padding bits here. Silly. :-) */
 
-	pskb_trim(skb, skb->len - alen - padlen - 2);
-	__skb_pull(skb, hlen);
+	trimlen = alen + padlen + 2;
+	if (skb->ip_summed == CHECKSUM_COMPLETE) {
+		csumdiff = skb_checksum(skb, skb->len - trimlen, trimlen, 0);
+		skb->csum = csum_block_sub(skb->csum, csumdiff,
+					   skb->len - trimlen);
+	}
+	pskb_trim(skb, skb->len - trimlen);
+
+	skb_pull_rcsum(skb, hlen);
 	if (x->props.mode == XFRM_MODE_TUNNEL)
 		skb_reset_transport_header(skb);
 	else
diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
index f02f131..eec3add 100644
--- a/net/ipv6/esp6_offload.c
+++ b/net/ipv6/esp6_offload.c
@@ -209,11 +209,13 @@ static struct sk_buff *esp6_gso_segment(struct sk_buff *skb,
 static int esp6_input_tail(struct xfrm_state *x, struct sk_buff *skb)
 {
 	struct crypto_aead *aead = x->data;
+	struct xfrm_offload *xo = xfrm_offload(skb);
 
 	if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead)))
 		return -EINVAL;
 
-	skb->ip_summed = CHECKSUM_NONE;
+	if (!(xo->flags & CRYPTO_DONE))
+		skb->ip_summed = CHECKSUM_NONE;
 
 	return esp6_input_done2(skb, 0);
 }
-- 
2.7.4

^ permalink raw reply related

* [PATCH 3/8] xfrm6: Fix CHECKSUM_COMPLETE after IPv6 header push
From: Steffen Klassert @ 2017-08-21  5:49 UTC (permalink / raw)
  To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev
In-Reply-To: <1503294573-10206-1-git-send-email-steffen.klassert@secunet.com>

From: Yossi Kuperman <yossiku@mellanox.com>

xfrm6_transport_finish rebuilds the IPv6 header based on the
original one and pushes it back without fixing skb->csum.
Therefore, CHECKSUM_COMPLETE is no longer valid and the packet
gets dropped.

Fix skb->csum by calling skb_postpush_rcsum.

Note: A valid IPv4 header has checksum 0, unlike IPv6. Thus,
the change is not needed in the sibling xfrm4_transport_finish
function.

Signed-off-by: Yossi Kuperman <yossiku@mellanox.com>
Signed-off-by: Ilan Tayari <ilant@mellanox.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/ipv6/xfrm6_input.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c
index 3ef5d91..f95943a 100644
--- a/net/ipv6/xfrm6_input.c
+++ b/net/ipv6/xfrm6_input.c
@@ -34,6 +34,7 @@ EXPORT_SYMBOL(xfrm6_rcv_spi);
 int xfrm6_transport_finish(struct sk_buff *skb, int async)
 {
 	struct xfrm_offload *xo = xfrm_offload(skb);
+	int nhlen = skb->data - skb_network_header(skb);
 
 	skb_network_header(skb)[IP6CB(skb)->nhoff] =
 		XFRM_MODE_SKB_CB(skb)->protocol;
@@ -43,8 +44,9 @@ int xfrm6_transport_finish(struct sk_buff *skb, int async)
 		return 1;
 #endif
 
-	__skb_push(skb, skb->data - skb_network_header(skb));
+	__skb_push(skb, nhlen);
 	ipv6_hdr(skb)->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
+	skb_postpush_rcsum(skb, skb_network_header(skb), nhlen);
 
 	if (xo && (xo->flags & XFRM_GRO)) {
 		skb_mac_header_rebuild(skb);
-- 
2.7.4

^ permalink raw reply related

* pull request (net-next): ipsec-next 2017-08-21
From: Steffen Klassert @ 2017-08-21  5:49 UTC (permalink / raw)
  To: David Miller; +Cc: Herbert Xu, Steffen Klassert, netdev

1) Support RX checksum with IPsec crypto offload for esp4/esp6.
   From Ilan Tayari.

2) Fixup IPv6 checksums when doing IPsec crypto offload.
   From Yossi Kuperman.

3) Auto load the xfrom offload modules if a user installs
   a SA that requests IPsec offload. From Ilan Tayari.

4) Clear RX offload informations in xfrm_input to not
   confuse the TX path with stale offload informations.
   From Ilan Tayari.

5) Allow IPsec GSO for local sockets if the crypto operation
   will be offloaded.

6) Support setting of an output mark to the xfrm_state.
   This mark can be used to to do the tunnel route lookup.
   From Lorenzo Colitti.

Please pull or let me know if there are problems.

Thanks!

The following changes since commit cb5b136c0095d434cb63495da8efb6a3d663a38f:

  Merge branch 'dsa-rework-EEE-support' (2017-08-01 20:09:10 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next.git master

for you to fetch changes up to 077fbac405bfc6d41419ad6c1725804ad4e9887c:

  net: xfrm: support setting an output mark. (2017-08-11 07:03:00 +0200)

----------------------------------------------------------------
Ilan Tayari (4):
      esp4: Support RX checksum with crypto offload
      esp6: Support RX checksum with crypto offload
      xfrm: Auto-load xfrm offload modules
      xfrm: Clear RX SKB secpath xfrm_offload

Lorenzo Colitti (1):
      net: xfrm: support setting an output mark.

Steffen Klassert (1):
      net: Allow IPsec GSO for local sockets

Yossi Kuperman (2):
      xfrm6: Fix CHECKSUM_COMPLETE after IPv6 header push
      esp6: Fix RX checksum after header pull

 include/net/xfrm.h        | 32 ++++++++++++++++++++++++++++----
 include/uapi/linux/xfrm.h |  1 +
 net/core/sock.c           |  2 +-
 net/ipv4/esp4.c           | 14 +++++++++++---
 net/ipv4/esp4_offload.c   |  5 ++++-
 net/ipv4/xfrm4_policy.c   | 14 +++++++++-----
 net/ipv6/esp6.c           | 16 +++++++++++++---
 net/ipv6/esp6_offload.c   |  5 ++++-
 net/ipv6/xfrm6_input.c    |  4 +++-
 net/ipv6/xfrm6_policy.c   |  9 ++++++---
 net/xfrm/xfrm_device.c    |  5 +++--
 net/xfrm/xfrm_input.c     |  2 ++
 net/xfrm/xfrm_output.c    |  3 +++
 net/xfrm/xfrm_policy.c    | 17 +++++++++--------
 net/xfrm/xfrm_state.c     | 16 ++++++++++++----
 net/xfrm/xfrm_user.c      | 13 ++++++++++++-
 16 files changed, 121 insertions(+), 37 deletions(-)

^ permalink raw reply

* [GIT] Networking
From: David Miller @ 2017-08-21  4:53 UTC (permalink / raw)
  To: torvalds; +Cc: akpm, netdev, linux-kernel


1) Fix IGMP handling wrt VRF, from David Ahern.

2) Fix timer access to freed object in dccp, from Eric Dumazet.

3) Use kmalloc_array() in ptr_ring to avoid overflow cases which
   are triggerable by userspace.  Also from Eric Dumazet.

4) Fix infinite loop in unmapping cleanup of nfp driver, from Colin
   Ian King.

5) Correct datagram peek handling of empty SKBs, from Matthew Dawson.

6) Fix use after free in TIPC, from Eric Dumazet.

7) When replacing a route in ipv6 we need to reset the round robin
   pointer, from Wei Wang.

8) Fix bug in pci_find_pcie_root_port() which was unearthed by the
   relaxed ordering changes, from Thierry Redding.  I made sure to get
   an explicit ACK from Bjorn this time around :-)

Please pull, thanks a lot!

The following changes since commit 510c8a899caf095cb13d09d203573deef15db2fe:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2017-08-15 18:52:28 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 

for you to fetch changes up to 348a4002729ccab8b888b38cbc099efa2f2a2036:

  ipv6: repair fib6 tree in failure case (2017-08-20 20:06:56 -0700)

----------------------------------------------------------------
Alexander Potapenko (1):
      sctp: fully initialize the IPv6 address in sctp_v6_to_addr()

Chris Packham (1):
      switchdev: documentation: minor typo fixes

Colin Ian King (3):
      nfp: fix infinite loop on umapping cleanup
      netxen: fix incorrect loop counter decrement
      irda: do not leak initialized list.dev to userspace

Daniel Borkmann (2):
      bpf, doc: improve sysctl knob description
      bpf, doc: also add s390x as arch to sysctl description

David Ahern (1):
      net: igmp: Use ingress interface rather than vrf device

David Howells (1):
      rxrpc: Fix oops when discarding a preallocated service call

Eric Dumazet (5):
      dccp: defer ccid_hc_tx_delete() at dismantle time
      ptr_ring: use kmalloc_array()
      ipv4: better IP_MAX_MTU enforcement
      tun: handle register_netdevice() failures properly
      tipc: fix use-after-free

Eric Leblond (1):
      tools lib bpf: improve warning

Huy Nguyen (1):
      net/mlx4_core: Enable 4K UAR if SRIOV module parameter is not enabled

Jiri Pirko (1):
      net: sched: fix p_filter_chain check in tcf_chain_flush

Konstantin Khlebnikov (1):
      net_sched: fix order of queue length updates in qdisc_replace()

Liping Zhang (1):
      openvswitch: fix skb_panic due to the incorrect actions attrlen

Matthew Dawson (1):
      datagram: When peeking datagrams with offset < 0 don't skip empty skbs

Michael Ellerman (1):
      bpf: Update sysctl documentation to list all supported architectures

Neal Cardwell (1):
      tcp: when rearming RTO, if RTO time is in past then fire RTO ASAP

Roopa Prabhu (1):
      net: check and errout if res->fi is NULL when RTM_F_FIB_MATCH is set

Thierry Reding (1):
      PCI: Allow PCI express root ports to find themselves

Wei Wang (2):
      ipv6: reset fn->rr_ptr when replacing route
      ipv6: repair fib6 tree in failure case

Xin Long (1):
      net: sched: fix NULL pointer dereference when action calls some targets

 Documentation/networking/switchdev.txt              |  4 ++--
 Documentation/sysctl/net.txt                        | 47 ++++++++++++++++++++++++++++++++++++-----------
 drivers/net/ethernet/mellanox/mlx4/main.c           |  4 ++--
 drivers/net/ethernet/netronome/nfp/nfp_net_common.c |  3 +--
 drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c  |  2 +-
 drivers/net/tun.c                                   |  3 +++
 drivers/pci/pci.c                                   |  9 ++++-----
 include/linux/ptr_ring.h                            |  9 +++++----
 include/linux/skb_array.h                           |  3 ++-
 include/net/ip.h                                    |  4 ++--
 include/net/sch_generic.h                           |  5 ++++-
 include/net/sock.h                                  |  4 +---
 net/core/datagram.c                                 | 12 +++++++++---
 net/dccp/proto.c                                    | 14 ++++++++++++--
 net/ipv4/igmp.c                                     | 10 +++++++++-
 net/ipv4/route.c                                    | 13 ++++++++++---
 net/ipv4/tcp_input.c                                |  3 +--
 net/ipv4/udp.c                                      |  3 ++-
 net/ipv6/ip6_fib.c                                  | 28 +++++++++++++++-------------
 net/ipv6/udp.c                                      |  3 ++-
 net/irda/af_irda.c                                  |  2 +-
 net/openvswitch/actions.c                           |  1 +
 net/openvswitch/datapath.c                          |  7 ++++---
 net/openvswitch/datapath.h                          |  2 ++
 net/rxrpc/call_accept.c                             |  1 +
 net/sched/act_ipt.c                                 |  2 ++
 net/sched/cls_api.c                                 |  2 +-
 net/sctp/ipv6.c                                     |  2 ++
 net/tipc/netlink_compat.c                           |  6 ++++--
 net/unix/af_unix.c                                  |  5 +----
 tools/lib/bpf/libbpf.c                              |  3 ++-
 31 files changed, 144 insertions(+), 72 deletions(-)

^ permalink raw reply

* Re: [PATCH net-next] liquidio: fix use of pf in pass-through mode in a virtual machine
From: David Miller @ 2017-08-21  3:21 UTC (permalink / raw)
  To: felix.manlunas
  Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla,
	ricardo.farrington
In-Reply-To: <20170819012149.GA4838@felix-thinkpad.cavium.com>

From: Felix Manlunas <felix.manlunas@cavium.com>
Date: Fri, 18 Aug 2017 18:21:49 -0700

> From: Rick Farrington <ricardo.farrington@cavium.com>
> 
> Fix problem when PF is used in pass-through mode in a VM (w/embedded f/w).
> 
> If host error reading PF num from CN23XX_PCIE_SRIOV_FDL reg,
> try to retrieve PF num from SLI_PKT(0)_INPUT_CONTROL (initialized by f/w).
> 
> Signed-off-by: Rick Farrington <ricardo.farrington@cavium.com>
> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>

Applied.

^ permalink raw reply

* Re: [PATCH 1/2] vhost: remove the possible fruitless search on iotlb prefetch
From: Jason Wang @ 2017-08-21  3:09 UTC (permalink / raw)
  To: Koichiro Den, mst; +Cc: kvm, virtualization, netdev
In-Reply-To: <20170819064114.27219-1-den@klaipeden.com>



On 2017年08月19日 14:41, Koichiro Den wrote:
> Signed-off-by: Koichiro Den <den@klaipeden.com>
> ---
>   drivers/vhost/vhost.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> index e4613a3c362d..93e909afc1c3 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -1184,7 +1184,7 @@ static int iotlb_access_ok(struct vhost_virtqueue *vq,
>   	while (len > s) {
>   		node = vhost_umem_interval_tree_iter_first(&umem->umem_tree,
>   							   addr,
> -							   addr + len - 1);
> +							   addr + len - s - 1);
>   		if (node == NULL || node->start > addr) {
>   			vhost_iotlb_miss(vq, addr, access);
>   			return false;

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

^ permalink raw reply

* Re: [PATCH net] ipv6: repair fib6 tree in failure case
From: David Miller @ 2017-08-21  3:07 UTC (permalink / raw)
  To: weiwan; +Cc: netdev, edumazet
In-Reply-To: <20170819001449.42844-1-tracywwnj@gmail.com>

From: Wei Wang <weiwan@google.com>
Date: Fri, 18 Aug 2017 17:14:49 -0700

> From: Wei Wang <weiwan@google.com>
> 
> In fib6_add(), it is possible that fib6_add_1() picks an intermediate
> node and sets the node's fn->leaf to NULL in order to add this new
> route. However, if fib6_add_rt2node() fails to add the new
> route for some reason, fn->leaf will be left as NULL and could
> potentially cause crash when fn->leaf is accessed in fib6_locate().
> This patch makes sure fib6_repair_tree() is called to properly repair
> fn->leaf in the above failure case.
> 
> Here is the syzkaller reported general protection fault in fib6_locate:
 ...
> Note: there is no "Fixes" tag as this seems to be a bug introduced
> very early.
> 
> Signed-off-by: Wei Wang <weiwan@google.com>
> Acked-by: Eric Dumazet <edumazet@google.com>

Applied and queued up for -stable.

^ permalink raw reply

* Re: [PATCH 2/2] vhost-net: revert vhost_exceeds_maxpend logic to its original
From: Jason Wang @ 2017-08-21  3:06 UTC (permalink / raw)
  To: Koichiro Den, mst; +Cc: netdev, kvm, virtualization
In-Reply-To: <20170819064129.27272-1-den@klaipeden.com>



On 2017年08月19日 14:41, Koichiro Den wrote:
> To depend on vq.num and the usage of VHOST_MAX_PEND is not succinct
> and in some case unexpected, so revert its logic part only.

Hi:

Could you explain a little bit more on the case that is was not sufficent?

Thanks

>
> Signed-off-by: Koichiro Den <den@klaipeden.com>
> ---
>   drivers/vhost/net.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index 06d044862e58..99cf99b308a7 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -433,11 +433,15 @@ static int vhost_net_tx_get_vq_desc(struct vhost_net *net,
>   
>   static bool vhost_exceeds_maxpend(struct vhost_net *net)
>   {
> +	int num_pends;
>   	struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_TX];
>   	struct vhost_virtqueue *vq = &nvq->vq;
>   
> -	return (nvq->upend_idx + vq->num - VHOST_MAX_PEND) % UIO_MAXIOV
> -		== nvq->done_idx;
> +	num_pends = likely(nvq->upend_idx >= nvq->done_idx) ?
> +		(nvq->upend_idx - nvq->done_idx) :
> +		(nvq->upend_idx + UIO_MAXIOV - nvq->done_idx);
> +
> +	return num_pends > VHOST_MAX_PEND;
>   }
>   
>   /* Expects to be always run from workqueue - which acts as

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply

* Re: [PATCH 0/3] MIPS,bpf: Improvements for MIPS eBPF JIT
From: David Miller @ 2017-08-21  3:06 UTC (permalink / raw)
  To: david.daney; +Cc: ast, daniel, netdev, linux-kernel, linux-mips, ralf
In-Reply-To: <20170818234033.5990-1-david.daney@cavium.com>

From: David Daney <david.daney@cavium.com>
Date: Fri, 18 Aug 2017 16:40:30 -0700

> I suggest that the whole thing go via the BPF/net-next path as there
> are dependencies on code that is not yet merged to Linus' tree.

What kind of dependency?  On networking or MIPS changes?

If the dependency is on MIPS changes, then if I cannot apply this as
it will break the net-next build on MIPS.  You should merge this
via the MIPS tree, where the dependencies are, in that case.

Please clarify what is specifically happening here.

Thanks.

^ permalink raw reply

* Re: [PATCH] net: dsa: mv88e6xxx: make irq_chip const
From: David Miller @ 2017-08-21  3:03 UTC (permalink / raw)
  To: bhumirks
  Cc: julia.lawall, andrew, vivien.didelot, f.fainelli, netdev,
	linux-kernel
In-Reply-To: <1503140152-7719-1-git-send-email-bhumirks@gmail.com>

From: Bhumika Goyal <bhumirks@gmail.com>
Date: Sat, 19 Aug 2017 16:25:52 +0530

> Make this const as it is only used in a copy operation.
> Done using Coccinelle.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

Applied to net-next, thanks.

^ permalink raw reply

* Re: [PATCH] net_sched: fix order of queue length updates in qdisc_replace()
From: David Miller @ 2017-08-21  3:01 UTC (permalink / raw)
  To: khlebnikov; +Cc: netdev, xiyou.wangcong, jiri
In-Reply-To: <150314622756.18396.5215271249872220640.stgit@buzz>

From: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Date: Sat, 19 Aug 2017 15:37:07 +0300

> This important to call qdisc_tree_reduce_backlog() after changing queue
> length. Parent qdisc should deactivate class in ->qlen_notify() called from
> qdisc_tree_reduce_backlog() but this happens only if qdisc->q.qlen in zero.
> 
> Missed class deactivations leads to crashes/warnings at picking packets
> from empty qdisc and corrupting state at reactivating this class in future.
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
> Fixes: 86a7996cc8a0 ("net_sched: introduce qdisc_replace() helper")

Applied and queued up for -stable, thanks.

Please do not add an explict "CC: stable" to networking patches, simply
ask me to queue it up as I handle all networking -stable submissions
myself by hand.

Thank you.

^ permalink raw reply

* Re: [PATCH net v2] ipv6: add rcu grace period before freeing fib6_node
From: David Miller @ 2017-08-21  2:59 UTC (permalink / raw)
  To: weiwan; +Cc: netdev, edumazet, kafai
In-Reply-To: <20170820003408.133176-1-tracywwnj@gmail.com>

From: Wei Wang <weiwan@google.com>
Date: Sat, 19 Aug 2017 17:34:08 -0700

> From: Wei Wang <weiwan@google.com>
> 
> We currently keep rt->rt6i_node pointing to the fib6_node for the route.
> And some functions make use of this pointer to dereference the fib6_node
> from rt structure, e.g. rt6_check(). However, as there is neither
> refcount nor rcu taken when dereferencing rt->rt6i_node, it could
> potentially cause crashes as rt->rt6i_node could be set to NULL by other
> CPUs when doing a route deletion.
> This patch introduces an rcu grace period before freeing fib6_node and
> makes sure the functions that dereference it takes rcu_read_lock().
> 
> Note: there is no "Fixes" tag because this bug was there in a very
> early stage.
> 
> Signed-off-by: Wei Wang <weiwan@google.com>
> Acked-by: Eric Dumazet <edumazet@google.com>
> ---
> v2: removed one extra empty line

Goodness.... where to start.

If this bug has been around forever, why did you make this patch
against net-next instead of net?  (I can tell just by looking at
the patch because rt6_free_pcpu() is static in 'net' yet it is
not static in the diff hunk which matches net-next)

And if you made it against net-next, why are you saying "net" in
your subject line instead of "[PATCH net-next v2]"?

Please sort this out properly, and resubmit.

Thank you.

^ permalink raw reply

* Re: [PATCH v2] net: ibm: emac: Fix some error handling path in 'emac_probe()'
From: David Miller @ 2017-08-21  2:53 UTC (permalink / raw)
  To: christophe.jaillet
  Cc: chunkeey, jarod, ivan, ebiggers, tklauser, tremyfr, robh, netdev,
	linux-kernel, kernel-janitors
In-Reply-To: <20170820043500.24864-1-christophe.jaillet@wanadoo.fr>

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date: Sun, 20 Aug 2017 06:35:00 +0200

> If 'irq_of_parse_and_map()' or 'of_address_to_resource()' fail, 'err' is
> known to be 0 at this point.
> So return -ENODEV instead in the first case and use 'of_iomap()' instead of
> the equivalent 'of_address_to_resource()/ioremap()' combinaison in the 2nd
> case.
> 
> Doing so, the 'rsrc_regs' field of the 'emac_instance struct' becomes
> redundant and is removed.
> 
> While at it, turn a 'err != 0' test into an equivalent 'err' to be more
> consistent.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> v2: use of_iomap() to simplify code
>     remove 'rsrc_regs' field of the 'emac_instance struct'
>     update comment

Applied to net-next.

^ permalink raw reply

* Re: [PATCH net-next v2] cxgb4/cxgbvf: Handle 32-bit fw port capabilities
From: David Miller @ 2017-08-21  2:52 UTC (permalink / raw)
  To: ganeshgr; +Cc: netdev, nirranjan, indranil, leedom, venkatesh
In-Reply-To: <1503218751-24948-1-git-send-email-ganeshgr@chelsio.com>

From: Ganesh Goudar <ganeshgr@chelsio.com>
Date: Sun, 20 Aug 2017 14:15:51 +0530

> Implement new 32-bit Firmware Port Capabilities in order to
> handle new speeds which couldn't be represented in the old 16-bit
> Firmware Port Capabilities values.
> 
> Based on the original work of Casey Leedom <leedom@chelsio.com>
> 
> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
> ---
> v2: Fixes build error when DCB is enabled

Applied.

^ permalink raw reply

* Re: [PATCH] tools lib bpf: improve warning
From: David Miller @ 2017-08-21  2:50 UTC (permalink / raw)
  To: eric; +Cc: netdev
In-Reply-To: <20170820194814.13785-1-eric@regit.org>

From: Eric Leblond <eric@regit.org>
Date: Sun, 20 Aug 2017 21:48:14 +0200

> Signed-off-by: Eric Leblond <eric@regit.org>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] switchdev: documentation: minor typo fixes
From: David Miller @ 2017-08-21  2:49 UTC (permalink / raw)
  To: chris.packham; +Cc: netdev, corbet, linux-doc, linux-kernel
In-Reply-To: <20170820205255.29382-1-chris.packham@alliedtelesis.co.nz>

From: Chris Packham <chris.packham@alliedtelesis.co.nz>
Date: Mon, 21 Aug 2017 08:52:54 +1200

> Two typos in switchdev.txt
> 
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

Applied.

^ permalink raw reply

* Re: [PATCH net-next] bpf: fix double free from dev_map_notification()
From: David Miller @ 2017-08-21  2:46 UTC (permalink / raw)
  To: daniel; +Cc: john.fastabend, ast, netdev
In-Reply-To: <22ff5f74079470a06e11940f40e05b2db74ca21f.1503272633.git.daniel@iogearbox.net>

From: Daniel Borkmann <daniel@iogearbox.net>
Date: Mon, 21 Aug 2017 01:48:12 +0200

> In the current code, dev_map_free() can still race with dev_map_notification().
> In dev_map_free(), we remove dtab from the list of dtabs after we purged
> all entries from it. However, we don't do xchg() with NULL or the like,
> so the entry at that point is still pointing to the device. If a unregister
> notification comes in at the same time, we therefore risk a double-free,
> since the pointer is still present in the map, and then pushed again to
> __dev_map_entry_free().
> 
> All this is completely unnecessary. Just remove the dtab from the list
> right before the synchronize_rcu(), so all outstanding readers from the
> notifier list have finished by then, thus we don't need to deal with this
> corner case anymore and also wouldn't need to nullify dev entires. This is
> fine because we iterate over the map releasing all entries and therefore
> dev references anyway.
> 
> Fixes: 4cc7b9544b9a ("bpf: devmap fix mutex in rcu critical section")
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

Applied, thanks Daniel.

^ permalink raw reply

* Re: [PATCH net] bpf, doc: also add s390x as arch to sysctl description
From: David Miller @ 2017-08-21  2:45 UTC (permalink / raw)
  To: daniel; +Cc: ast, netdev
In-Reply-To: <23b5525b786a641eb777cf44839fd98189d27acb.1503267753.git.daniel@iogearbox.net>

From: Daniel Borkmann <daniel@iogearbox.net>
Date: Mon, 21 Aug 2017 00:26:03 +0200

> Looks like this was accidentally missed, so still add s390x
> as supported eBPF JIT arch to bpf_jit_enable.
> 
> Fixes: 014cd0a368dc ("bpf: Update sysctl documentation to list all supported architectures")
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH net-next] bpf: fix double free from dev_map_notification()
From: Daniel Borkmann @ 2017-08-21  0:47 UTC (permalink / raw)
  To: Alexei Starovoitov, davem; +Cc: john.fastabend, netdev
In-Reply-To: <52f70537-afcf-e384-cb96-2a5b8c032c51@fb.com>

On 08/21/2017 02:42 AM, Alexei Starovoitov wrote:
> On 8/20/17 4:48 PM, Daniel Borkmann wrote:
[...]
> I wonder why it was done the other way around in the first place then?
> dev_map_list is there only for notifier and since the map is freed
> with all the devices totally makes sense to isolate it from notifier
> as a first step.

Yep, agree. Initially this was done by the mutex, but that was not
correct due to RCU for map helpers, of course.

^ permalink raw reply

* Re: [PATCH] tools lib bpf: improve warning
From: Alexei Starovoitov @ 2017-08-21  0:44 UTC (permalink / raw)
  To: Eric Leblond; +Cc: netdev, Wangnan
In-Reply-To: <20170820194814.13785-1-eric@regit.org>

On Sun, Aug 20, 2017 at 09:48:14PM +0200, Eric Leblond wrote:
> Signed-off-by: Eric Leblond <eric@regit.org>
> ---
>  tools/lib/bpf/libbpf.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index 1cc3ea0ffdc3..35f6dfcdc565 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -879,7 +879,8 @@ bpf_object__create_maps(struct bpf_object *obj)
>  			size_t j;
>  			int err = *pfd;
>  
> -			pr_warning("failed to create map: %s\n",
> +			pr_warning("failed to create map (name: '%s'): %s\n",
> +				   obj->maps[i].name,
>  				   strerror(errno));

makes sense.
Acked-by: Alexei Starovoitov <ast@kernel.org>
Please cc Wang for future libbpf patches.

^ 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