svn commit: r338612 - stable/11/sys/ofed/include/rdma

Hans Petter Selasky hselasky at FreeBSD.org
Wed Sep 12 08:56:09 UTC 2018


Author: hselasky
Date: Wed Sep 12 08:56:08 2018
New Revision: 338612
URL: https://svnweb.freebsd.org/changeset/base/338612

Log:
  MFC r338491:
  ibcore: Fix endless loop in searching for matching VLAN device
  
  In r337943 ifnet's if_pcp was set to the PCP value in use
  instead of IFNET_PCP_NONE.
  Current ibcore code assumes that if_pcp is IFNET_PCP_NONE with
  VLAN interfaces so it can identify prio-tagged traffic.
  Fix that by explicitly verifying that that the if_type is IFT_ETHER
  and not IFT_L2VLAN.
  
  Approved by:    re (Marius), hselasky (mentor), kib (mentor)
  Sponsored by:   Mellanox Technologies

Modified:
  stable/11/sys/ofed/include/rdma/ib_addr.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/ofed/include/rdma/ib_addr.h
==============================================================================
--- stable/11/sys/ofed/include/rdma/ib_addr.h	Wed Sep 12 08:46:49 2018	(r338611)
+++ stable/11/sys/ofed/include/rdma/ib_addr.h	Wed Sep 12 08:56:08 2018	(r338612)
@@ -165,7 +165,7 @@ static inline u16 rdma_vlan_dev_vlan_id(const struct n
 {
 	uint16_t tag;
 
-	if (dev->if_pcp != IFNET_PCP_NONE)
+	if (dev->if_type == IFT_ETHER && dev->if_pcp != IFNET_PCP_NONE)
 		return 0x0000;	/* prio-tagged traffic */
 	if (VLAN_TAG(__DECONST(struct ifnet *, dev), &tag) != 0)
 		return 0xffff;
@@ -352,7 +352,7 @@ static inline u16 rdma_get_vlan_id(union ib_gid *dgid)
 
 static inline struct net_device *rdma_vlan_dev_real_dev(struct net_device *dev)
 {
-	if (dev->if_pcp != IFNET_PCP_NONE)
+	if (dev->if_type == IFT_ETHER && dev->if_pcp != IFNET_PCP_NONE)
 		return dev; /* prio-tagged traffic */
 	return VLAN_TRUNKDEV(__DECONST(struct ifnet *, dev));
 }


More information about the svn-src-stable mailing list