]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
bareudp: Reverted support to enable & disable rx metadata collection
authorMartin Varghese <martin.varghese@nokia.com>
Fri, 17 Jul 2020 02:35:12 +0000 (08:05 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Jul 2020 01:30:47 +0000 (18:30 -0700)
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>
Acked-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/bareudp.rst
drivers/net/bareudp.c
include/net/bareudp.h
include/uapi/linux/if_link.h

index 0e00636d8d74c5c473ba541efcedcfbc526d6428..465a8b251bfeca4dc865d568ca368d38e8e76d02 100644 (file)
@@ -48,7 +48,5 @@ enabled.
 The bareudp device could be used along with OVS or flower filter in TC.
 The OVS or TC flower layer must set the tunnel information in SKB dst field before
 sending packet buffer to the bareudp device for transmission. On reception the
-bareudp device decapsulates the udp header and passes the inner packet to the
-network stack. If RX_COLLECT_METADATA flag is enabled in the device the tunnel
-information will be stored in the SKB dst field before the packet buffer is
-passed to the network stack.
+bareudp device extracts and stores the tunnel information in SKB dst field before
+passing the packet buffer to the network stack.
index 108a8cafc4f8e7c5e5ae3e5b7898a8004445cbe8..44eb2b1d0416f1232b94a9d6875c531f01eb8599 100644 (file)
@@ -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;
 
index 3dd5f9a8d01c784de68c4c60d34ce15e1e426616..dc65a0d71d9b27f9f8920026319b247ec56697ec 100644 (file)
@@ -12,7 +12,6 @@ struct bareudp_conf {
        __be16 port;
        u16 sport_min;
        bool multi_proto_mode;
-       bool rx_collect_metadata;
 };
 
 struct net_device *bareudp_dev_create(struct net *net, const char *name,
index 26842ffd0501df3070c2655bfd22f700ee153454..af8f3198752622baae5b3ef4f0225411e1c76d96 100644 (file)
@@ -601,7 +601,6 @@ enum {
        IFLA_BAREUDP_ETHERTYPE,
        IFLA_BAREUDP_SRCPORT_MIN,
        IFLA_BAREUDP_MULTIPROTO_MODE,
-       IFLA_BAREUDP_RX_COLLECT_METADATA,
        __IFLA_BAREUDP_MAX
 };