[ovs-dev] [patch net-next RFC 08/12] net: introduce netdev_phys_item_ids_match helper

Jiri Pirko jiri at resnulli.us
Thu Aug 21 16:19:01 UTC 2014


Signed-off-by: Jiri Pirko <jiri at resnulli.us>
Acked-by: Scott Feldman <sfeldma at cumulusnetworks.com>
---
 include/linux/netdevice.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 8b5d14c..b48028d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -751,6 +751,13 @@ struct netdev_phys_item_id {
 	unsigned char id_len;
 };
 
+static inline bool netdev_phys_item_ids_match(struct netdev_phys_item_id *id1,
+					      struct netdev_phys_item_id *id2)
+{
+	return id1->id_len == id2->id_len &&
+	       !memcmp(id1->id, id2->id, id1->id_len);
+}
+
 typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
 				       struct sk_buff *skb);
 
-- 
1.9.3




More information about the dev mailing list