Thread (23 messages) 23 messages, 3 authors, 2024-08-21

Re: [PATCH net-next 08/10] net: vxlan: add drop reasons support to vxlan_xmit_one()

From: Menglong Dong <hidden>
Date: 2024-08-21 13:02:27
Also in: lkml

On Tue, Aug 20, 2024 at 8:33 PM Ido Schimmel [off-list ref] wrote:
On Thu, Aug 15, 2024 at 08:43:00PM +0800, Menglong Dong wrote:
quoted
diff --git a/drivers/net/vxlan/drop.h b/drivers/net/vxlan/drop.h
index da30cb4a9ed9..542f391b1273 100644
--- a/drivers/net/vxlan/drop.h
+++ b/drivers/net/vxlan/drop.h
@@ -14,6 +14,7 @@
      R(VXLAN_DROP_MAC)                       \
      R(VXLAN_DROP_TXINFO)                    \
      R(VXLAN_DROP_REMOTE)                    \
+     R(VXLAN_DROP_REMOTE_IP)                 \
      /* deliberate comment for trailing \ */

 enum vxlan_drop_reason {
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index 22e2bf532ac3..c1bae120727f 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -2375,6 +2375,7 @@ void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
      bool xnet = !net_eq(vxlan->net, dev_net(vxlan->dev));
      bool no_eth_encap;
      __be32 vni = 0;
+     SKB_DR(reason);

      no_eth_encap = flags & VXLAN_F_GPE && skb->protocol != htons(ETH_P_TEB);
      if (!skb_vlan_inet_prepare(skb, no_eth_encap))
@@ -2396,6 +2397,7 @@ void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
                                                 default_vni, true);
                              return;
                      }
+                     reason = (u32)VXLAN_DROP_REMOTE_IP;
This looks quite obscure to me. I didn't know you can add 0.0.0.0 as
remote and I'm not sure what is the use case. Personally I wouldn't
bother with this reason.
I know. I'm hesitant about this commit, as I don't find a case
for this dropping, and the remote seems can't be 0.0.0.0.
I add this reason as the code drops the packet here.

Enn...I will abandon this commit.

Thanks!
Menglong Dong
quoted
                      goto drop;
              }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help