netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] bareudp: Reverted support to enable & disable rx metadata collection
@ 2020-07-15  3:12 Martin Varghese
  2020-07-15 20:43 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Varghese @ 2020-07-15  3:12 UTC (permalink / raw)
  To: netdev, davem, gnault; +Cc: Martin Varghese

From: Martin Varghese <martin.varghese@nokia.com>

The commit fe80536acf83 ("bareudp: Added attribute to enable & disable
rx metadata collection") breaks the the original(5.7) default behavior of
bareudp module to collect RX metadadata at the receive. It was added to
avoid the crash at the kernel neighbour subsytem when packet with metadata
from bareudp is processed. But it is no more needed as the
commit 394de110a733 ("net: Added pointer check for
dst->ops->neigh_lookup in dst_neigh_lookup_skb") solves this crash.

Fixes: fe80536acf83 ("bareudp: Added attribute to enable & disable rx metadata collection")
Signed-off-by: Martin Varghese <martin.varghese@nokia.com>
---
 drivers/net/bareudp.c        | 21 +++++----------------
 include/uapi/linux/if_link.h |  1 -
 2 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c
index 108a8cafc4f8..44eb2b1d0416 100644
--- a/drivers/net/bareudp.c
+++ b/drivers/net/bareudp.c
@@ -46,7 +46,6 @@ struct bareudp_dev {
 	__be16             port;
 	u16	           sport_min;
 	bool               multi_proto_mode;
-	bool               rx_collect_metadata;
 	struct socket      __rcu *sock;
 	struct list_head   next;        /* bareudp node  on namespace list */
 	struct gro_cells   gro_cells;
@@ -126,14 +125,12 @@ static int bareudp_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
 		bareudp->dev->stats.rx_dropped++;
 		goto drop;
 	}
-	if (bareudp->rx_collect_metadata) {
-		tun_dst = udp_tun_rx_dst(skb, family, TUNNEL_KEY, 0, 0);
-		if (!tun_dst) {
-			bareudp->dev->stats.rx_dropped++;
-			goto drop;
-		}
-		skb_dst_set(skb, &tun_dst->dst);
+	tun_dst = udp_tun_rx_dst(skb, family, TUNNEL_KEY, 0, 0);
+	if (!tun_dst) {
+		bareudp->dev->stats.rx_dropped++;
+		goto drop;
 	}
+	skb_dst_set(skb, &tun_dst->dst);
 	skb->dev = bareudp->dev;
 	oiph = skb_network_header(skb);
 	skb_reset_network_header(skb);
@@ -577,9 +574,6 @@ static int bareudp2info(struct nlattr *data[], struct bareudp_conf *conf,
 	if (data[IFLA_BAREUDP_MULTIPROTO_MODE])
 		conf->multi_proto_mode = true;
 
-	if (data[IFLA_BAREUDP_RX_COLLECT_METADATA])
-		conf->rx_collect_metadata = true;
-
 	return 0;
 }
 
@@ -617,7 +611,6 @@ static int bareudp_configure(struct net *net, struct net_device *dev,
 	bareudp->ethertype = conf->ethertype;
 	bareudp->sport_min = conf->sport_min;
 	bareudp->multi_proto_mode = conf->multi_proto_mode;
-	bareudp->rx_collect_metadata = conf->rx_collect_metadata;
 
 	err = register_netdevice(dev);
 	if (err)
@@ -676,7 +669,6 @@ static size_t bareudp_get_size(const struct net_device *dev)
 		nla_total_size(sizeof(__be16)) +  /* IFLA_BAREUDP_ETHERTYPE */
 		nla_total_size(sizeof(__u16))  +  /* IFLA_BAREUDP_SRCPORT_MIN */
 		nla_total_size(0)              +  /* IFLA_BAREUDP_MULTIPROTO_MODE */
-		nla_total_size(0)              +  /* IFLA_BAREUDP_RX_COLLECT_METADATA */
 		0;
 }
 
@@ -693,9 +685,6 @@ static int bareudp_fill_info(struct sk_buff *skb, const struct net_device *dev)
 	if (bareudp->multi_proto_mode &&
 	    nla_put_flag(skb, IFLA_BAREUDP_MULTIPROTO_MODE))
 		goto nla_put_failure;
-	if (bareudp->rx_collect_metadata &&
-	    nla_put_flag(skb, IFLA_BAREUDP_RX_COLLECT_METADATA))
-		goto nla_put_failure;
 
 	return 0;
 
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index cc185a007ade..a009365ad67b 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -600,7 +600,6 @@ enum {
 	IFLA_BAREUDP_ETHERTYPE,
 	IFLA_BAREUDP_SRCPORT_MIN,
 	IFLA_BAREUDP_MULTIPROTO_MODE,
-	IFLA_BAREUDP_RX_COLLECT_METADATA,
 	__IFLA_BAREUDP_MAX
 };
 
-- 
2.18.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] bareudp: Reverted support to enable & disable rx metadata collection
  2020-07-15  3:12 [PATCH net-next] bareudp: Reverted support to enable & disable rx metadata collection Martin Varghese
@ 2020-07-15 20:43 ` Jakub Kicinski
  2020-07-16  2:46   ` Martin Varghese
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2020-07-15 20:43 UTC (permalink / raw)
  To: Martin Varghese; +Cc: netdev, davem, gnault, Martin Varghese

On Wed, 15 Jul 2020 08:42:40 +0530 Martin Varghese wrote:
> From: Martin Varghese <martin.varghese@nokia.com>
> 
> The commit fe80536acf83 ("bareudp: Added attribute to enable & disable
> rx metadata collection") breaks the the original(5.7) default behavior of
> bareudp module to collect RX metadadata at the receive. It was added to
> avoid the crash at the kernel neighbour subsytem when packet with metadata
> from bareudp is processed. But it is no more needed as the
> commit 394de110a733 ("net: Added pointer check for
> dst->ops->neigh_lookup in dst_neigh_lookup_skb") solves this crash.
> 
> Fixes: fe80536acf83 ("bareudp: Added attribute to enable & disable rx metadata collection")
> Signed-off-by: Martin Varghese <martin.varghese@nokia.com>

Looks like you didn't remove the mention of the RX_COLLECT_METADATA
flag from the documentation - is this intentional? 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] bareudp: Reverted support to enable & disable rx metadata collection
  2020-07-15 20:43 ` Jakub Kicinski
@ 2020-07-16  2:46   ` Martin Varghese
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Varghese @ 2020-07-16  2:46 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: netdev, davem, gnault, Martin Varghese

On Wed, Jul 15, 2020 at 01:43:47PM -0700, Jakub Kicinski wrote:
> On Wed, 15 Jul 2020 08:42:40 +0530 Martin Varghese wrote:
> > From: Martin Varghese <martin.varghese@nokia.com>
> > 
> > The commit fe80536acf83 ("bareudp: Added attribute to enable & disable
> > rx metadata collection") breaks the the original(5.7) default behavior of
> > bareudp module to collect RX metadadata at the receive. It was added to
> > avoid the crash at the kernel neighbour subsytem when packet with metadata
> > from bareudp is processed. But it is no more needed as the
> > commit 394de110a733 ("net: Added pointer check for
> > dst->ops->neigh_lookup in dst_neigh_lookup_skb") solves this crash.
> > 
> > Fixes: fe80536acf83 ("bareudp: Added attribute to enable & disable rx metadata collection")
> > Signed-off-by: Martin Varghese <martin.varghese@nokia.com>
> 
> Looks like you didn't remove the mention of the RX_COLLECT_METADATA
> flag from the documentation - is this intentional?

No I missed it. Thanks for pointing it out.

Thanks
Martin 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-16  2:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15  3:12 [PATCH net-next] bareudp: Reverted support to enable & disable rx metadata collection Martin Varghese
2020-07-15 20:43 ` Jakub Kicinski
2020-07-16  2:46   ` Martin Varghese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).