Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 May 2017 10:47:36 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Ian Lepore <ian@freebsd.org>
Cc:        Edward Tomasz Napierala <trasz@freebsd.org>, src-committers@freebsd.org,  svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r318017 - head/share/man/man4
Message-ID:  <20170510095816.X5705@besplex.bde.org>
In-Reply-To: <1494372587.59865.9.camel@freebsd.org>
References:  <201705090836.v498a9JJ035778@repo.freebsd.org> <1494372587.59865.9.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 9 May 2017, Ian Lepore wrote:

> On Tue, 2017-05-09 at 08:36 +0000, Edward Tomasz Napierala wrote:
>> Author: trasz
>> Date: Tue May=A0=A09 08:36:09 2017
>> New Revision: 318017
>> URL: https://svnweb.freebsd.org/changeset/base/318017
>>
>> Log:
>> =A0 Fix device paths for USB serial adapters: the formatting strings
>> =A0 contain "%u", differently from eg uart(4) which uses "%r".
>> =A0=A0
>
> What is %r and where is it documented?

In the source code.

It was a ddb internal (but supported by -fformat-extensions, except IIRC
for %jr (1)), but is now used by makedev().

For ddb, %r means to use ddb's radix.  All output in ddb must go through
db_printf().  db_printf() calls kvprintf() with ddb's radix as an arg.
Unlike printf(3), kvprintf(9) supports arbitrary radixes and special
formats like signed hex (%y format).  kvprintf() is of course
undocumented.  %y is another ddb internal, like %r except it is not
so useful or used outside of ddb.

make_dev() supports a dumbed down version of %r.  %r for make_dev()
always means radix 32.  This is implemented by calling vnsrprintf(9)
with a hard-coded 32 as an arg since kvprintf() is unsuitable.
vnsrprintf() is of course undocumented.

%r implies %d.  I think the strange-looking %dr works too, but the
normal-looking %rd might not.  db mostly use %...lr, but never a bare
%lr, so use of %r is a bit hard to grep for.  ddb rarely uses the long
long abomination or intmax_t (it assumes that plain long is long enough,
as was correct in C90), and never uses %...jr or %...yr, but I think
these work except for (1).  It might be a bug to hard-code hex or
decimal formats instead of using %r (this is sometimes done for
addresses, when the user's radix is not usually wanted, but is still
too hard-coded).

(1) kvprintf() handles extensions like %r and %y[r] in a general way that
should work if %d or %x[r] works.  But -fformat-extensions doesn't support
%r or %y for intmax_t, so these formats are unusable and unused in practice=
=2E

The serial driver man pages are still deficient in not documenting what
'?' and '*' mean.  '?' is not a general wild card, but means specifically
base 32 with 1 digit.  This naming scheme was familar since it was used
by ptys, to go up to 1024 with only 2 digits.  It is still documented
in pty(4) with enough details as 2 digits but not full range
([l-sL-S][0-9a-v]).  I'm not sure if the first digit is restricted by
the implementation or just by convention.

Bruce
From owner-svn-src-all@freebsd.org  Wed May 10 01:01:21 2017
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id F31EBD653FF;
 Wed, 10 May 2017 01:01:21 +0000 (UTC)
 (envelope-from davidcs@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CE8FD82;
 Wed, 10 May 2017 01:01:21 +0000 (UTC)
 (envelope-from davidcs@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4A11KRJ051952;
 Wed, 10 May 2017 01:01:20 GMT (envelope-from davidcs@FreeBSD.org)
Received: (from davidcs@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4A11KEw051951;
 Wed, 10 May 2017 01:01:20 GMT (envelope-from davidcs@FreeBSD.org)
Message-Id: <201705100101.v4A11KEw051951@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: davidcs set sender to
 davidcs@FreeBSD.org using -f
From: David C Somayajulu <davidcs@FreeBSD.org>
Date: Wed, 10 May 2017 01:01:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r318126 - head/sys/dev/qlnx/qlnxe
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>;
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 10 May 2017 01:01:22 -0000

Author: davidcs
Date: Wed May 10 01:01:20 2017
New Revision: 318126
URL: https://svnweb.freebsd.org/changeset/base/318126

Log:
  llh_func_filter needs to be configured for 100G
  
  MFC after:3 days

Modified:
  head/sys/dev/qlnx/qlnxe/ecore_dev.c

Modified: head/sys/dev/qlnx/qlnxe/ecore_dev.c
==============================================================================
--- head/sys/dev/qlnx/qlnxe/ecore_dev.c	Wed May 10 00:42:28 2017	(r318125)
+++ head/sys/dev/qlnx/qlnxe/ecore_dev.c	Wed May 10 01:01:20 2017	(r318126)
@@ -1986,6 +1986,15 @@ static enum _ecore_status_t ecore_hw_ini
 		}
 	}
 #endif
+	/* Add an LLH filter with the primary MAC address.  */
+	if (p_hwfn->p_dev->num_hwfns > 1 && IS_LEAD_HWFN(p_hwfn)) {
+		rc = ecore_llh_add_mac_filter(p_hwfn, p_ptt,
+					      p_hwfn->hw_info.hw_mac_addr);
+		if (rc != ECORE_SUCCESS)
+			DP_NOTICE(p_hwfn, false,
+				"Failed to add an LLH filter with the primary MAC\n");
+	}
+
 	if (b_hw_start) {
 		/* enable interrupts */
 		rc = ecore_int_igu_enable(p_hwfn, p_ptt, int_mode);
@@ -2473,6 +2482,11 @@ enum _ecore_status_t ecore_hw_stop(struc
 				rc2 = ECORE_UNKNOWN_ERROR;
 			}
 		}
+
+		/* remove the LLH filter with the primary MAC addres */
+		if (p_hwfn->p_dev->num_hwfns > 1 && IS_LEAD_HWFN(p_hwfn))
+			ecore_llh_remove_mac_filter(p_hwfn, p_ptt,
+				    p_hwfn->hw_info.hw_mac_addr);
 	} /* hwfn loop */
 
 	if (IS_PF(p_dev)) {
@@ -4569,7 +4583,7 @@ enum _ecore_status_t ecore_llh_add_mac_f
 	}
 
 	DP_VERBOSE(p_hwfn, ECORE_MSG_HW,
-		   "MAC: %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx is added at %d\n",
+		   "MAC: %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx is added at LLH entry %d\n",
 		   p_filter[0], p_filter[1], p_filter[2], p_filter[3],
 		   p_filter[4], p_filter[5], entry_num);
 
@@ -4651,7 +4665,7 @@ void ecore_llh_remove_mac_filter(struct 
 	}
 
 	DP_VERBOSE(p_hwfn, ECORE_MSG_HW,
-		   "MAC: %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx was removed from %d\n",
+		   "MAC: %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx was removed from LLH entry %d\n",
 		   p_filter[0], p_filter[1], p_filter[2], p_filter[3],
 		   p_filter[4], p_filter[5], entry_num);
 }
@@ -4760,37 +4774,37 @@ ecore_llh_add_protocol_filter(struct eco
 	switch (type) {
 	case ECORE_LLH_FILTER_ETHERTYPE:
 		DP_VERBOSE(p_hwfn, ECORE_MSG_HW,
-			   "ETH type %x is added at %d\n",
+			   "ETH type %x is added at LLH entry %d\n",
 			   source_port_or_eth_type, entry_num);
 		break;
 	case ECORE_LLH_FILTER_TCP_SRC_PORT:
 		DP_VERBOSE(p_hwfn, ECORE_MSG_HW,
-			   "TCP src port %x is added at %d\n",
+			   "TCP src port %x is added at LLH entry %d\n",
 			   source_port_or_eth_type, entry_num);
 		break;
 	case ECORE_LLH_FILTER_UDP_SRC_PORT:
 		DP_VERBOSE(p_hwfn, ECORE_MSG_HW,
-			   "UDP src port %x is added at %d\n",
+			   "UDP src port %x is added at LLH entry %d\n",
 			   source_port_or_eth_type, entry_num);
 		break;
 	case ECORE_LLH_FILTER_TCP_DEST_PORT:
 		DP_VERBOSE(p_hwfn, ECORE_MSG_HW,
-			   "TCP dst port %x is added at %d\n",
+			   "TCP dst port %x is added at LLH entry %d\n",
 			   dest_port, entry_num);
 		break;
 	case ECORE_LLH_FILTER_UDP_DEST_PORT:
 		DP_VERBOSE(p_hwfn, ECORE_MSG_HW,
-			   "UDP dst port %x is added at %d\n",
+			   "UDP dst port %x is added at LLH entry %d\n",
 			   dest_port, entry_num);
 		break;
 	case ECORE_LLH_FILTER_TCP_SRC_AND_DEST_PORT:
 		DP_VERBOSE(p_hwfn, ECORE_MSG_HW,
-			   "TCP src/dst ports %x/%x are added at %d\n",
+			   "TCP src/dst ports %x/%x are added at LLH entry %d\n",
 			   source_port_or_eth_type, dest_port, entry_num);
 		break;
 	case ECORE_LLH_FILTER_UDP_SRC_AND_DEST_PORT:
 		DP_VERBOSE(p_hwfn, ECORE_MSG_HW,
-			   "UDP src/dst ports %x/%x are added at %d\n",
+			   "UDP src/dst ports %x/%x are added at LLH entry %d\n",
 			   source_port_or_eth_type, dest_port, entry_num);
 			break;
 	}
@@ -4917,7 +4931,7 @@ ecore_llh_remove_protocol_filter(struct 
 	}
 
 	DP_VERBOSE(p_hwfn, ECORE_MSG_HW,
-		   "Protocol filter [type %d, source_port_or_eth_type 0x%x, dest_port 0x%x] was removed from %d\n",
+		   "Protocol filter [type %d, source_port_or_eth_type 0x%x, dest_port 0x%x] was removed from LLH entry %d\n",
 		   type, source_port_or_eth_type, dest_port, entry_num);
 }
 



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