Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Sep 2018 12:26:57 +0000 (UTC)
From:      Slava Shwartsman <slavash@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338491 - head/sys/ofed/include/rdma
Message-ID:  <201809061226.w86CQvBn046897@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: slavash
Date: Thu Sep  6 12:26:57 2018
New Revision: 338491
URL: https://svnweb.freebsd.org/changeset/base/338491

Log:
  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.
  
  MFC after:      3 days
  Approved by:    re (Marius), hselasky (mentor), kib (mentor)
  Sponsored by:   Mellanox Technologies

Modified:
  head/sys/ofed/include/rdma/ib_addr.h

Modified: head/sys/ofed/include/rdma/ib_addr.h
==============================================================================
--- head/sys/ofed/include/rdma/ib_addr.h	Thu Sep  6 12:19:36 2018	(r338490)
+++ head/sys/ofed/include/rdma/ib_addr.h	Thu Sep  6 12:26:57 2018	(r338491)
@@ -167,7 +167,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;
@@ -350,7 +350,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));
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809061226.w86CQvBn046897>