Thread (24 messages) 24 messages, 2 authors, 2023-03-15

Re: [PATCH net-next 09/11] vxlan: Add MDB data path support

From: Ido Schimmel <idosch@nvidia.com>
Date: 2023-03-15 07:58:48
Also in: bridge

On Tue, Mar 14, 2023 at 02:35:08PM +0200, Nikolay Aleksandrov wrote:
On 13/03/2023 16:53, Ido Schimmel wrote:
quoted
+struct vxlan_mdb_entry *vxlan_mdb_entry_skb_get(struct vxlan_dev *vxlan,
+						struct sk_buff *skb,
+						__be32 src_vni)
+{
+	struct vxlan_mdb_entry *mdb_entry;
+	struct vxlan_mdb_entry_key group;
+
+	if (!is_multicast_ether_addr(eth_hdr(skb)->h_dest) ||
+	    is_broadcast_ether_addr(eth_hdr(skb)->h_dest))
+		return NULL;
+
+	/* When not in collect metadata mode, 'src_vni' is zero, but MDB
+	 * entries are stored with the VNI of the VXLAN device.
+	 */
+	if (!(vxlan->cfg.flags & VXLAN_F_COLLECT_METADATA))
+		src_vni = vxlan->default_dst.remote_vni;
+
+	memset(&group, 0, sizeof(group));
+	group.vni = src_vni;
+
+	switch (ntohs(skb->protocol)) {
drop the ntohs and..
quoted
+	case ETH_P_IP:
htons(ETH_P_IP)
Done. Thanks a lot for the review!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help