From nobody Tue Oct 8 12:25:31 2024 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XNFbh0Ybcz5ZMt9 for ; Tue, 08 Oct 2024 12:25:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XNFbg2Pmfz4Z5V; Tue, 8 Oct 2024 12:25:35 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-7ae3e3db294so318590785a.2; Tue, 08 Oct 2024 05:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728390334; x=1728995134; darn=freebsd.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :from:to:cc:subject:date:message-id:reply-to; bh=ZfHu95JKT7WwA0U3Dmr5RYnZvNWIz8Un5R9bI531kyw=; b=jv/0TCTDcv7LQTallRmQ3BpCzrdhcLtvqZpi3HM9FRNG8GELVqsW8YooxGYXRetQaa 5yXq2T7g0ROhcMH3cmL1/c/70h+rr0+YEnvarcUCEUK5Zbqg3Yvno/Kww9zQN14NUMGi 8Hzfw+ly2OkRDbHa8R44iWnuxs67i2jXNJ2eHzYHPmSVhrG/5Ezy7G1YiXZz15m5TT0l HRSMl5YJ69MCkxBwKG2xIJ0S59kwBMRGNcCWHsxdB17Y1wWhkzsC8P03trmr4jsXgrXe 3QDvxCyt1IvdYBSOJue/rIR/qO0/L0yTvO8/x80Lt5jVhpjyK0bWIoVGiljoX6/yLwO4 5AnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728390334; x=1728995134; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZfHu95JKT7WwA0U3Dmr5RYnZvNWIz8Un5R9bI531kyw=; b=KZv3QCIoxpfg6uIfolXID81pIlU2+ZfAecD+slPA+0BPP7/t0dLXs/7ztP/B5vsme7 0jKTlf415qEvk/KaC4d4vThhFZWktEvtISj0QkZPkk2r7hORJfEdLkKHqMb8Ho0SsLxJ w16DxiI1xIYP9+k4FEId6RPpvcBVRNMVtnvbKmqwpIcry6PBOaY06/iQUrn2Y5ZHeJ7h +m4YUHDSSil5ZnG3Q1u+HT/puWBKoU4zldrxLpMmks/l2MG7jT3iTkOqS4QdhUm/C8S9 aDbjxmqIDrVlH3PpGvki6yG0VNZraDIxMIlUyN76kdCDMCWjjFILvnZ63Rya5NDbMo5g 89Eg== X-Forwarded-Encrypted: i=1; AJvYcCVX/bH0fh0YsEJkDX/owPzU/ouMz6IT0Zdr8x6A4h9kUhA5LSzZR84nw0WQGv9VujLK7VVj9Q0cNeJ9oQ==@freebsd.org X-Gm-Message-State: AOJu0YzhPjTR6uAqp9kIwFklZaZxWdEVrGACgCfv1yt7302i0dH1wE4K C5pb8xn8VODXQGQtx57XwlSzMqWPx/uAOYJI+y3X/XYDdc3/ZQ6/cEyCcV4t X-Google-Smtp-Source: AGHT+IHaUYuSfpx0z6IKthcZDvuToq5WXUoWf2G8T18pdDKCXtJ9cE2jRl99G85QsfZl2Li6fTryEQ== X-Received: by 2002:a05:620a:2455:b0:7a9:dcbc:f82b with SMTP id af79cd13be357-7ae6f493b84mr2388695685a.54.1728390334002; Tue, 08 Oct 2024 05:25:34 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7ae7562bdf6sm349199985a.43.2024.10.08.05.25.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 05:25:33 -0700 (PDT) Date: Tue, 8 Oct 2024 08:25:31 -0400 From: Mark Johnston To: Zhenlei Huang Cc: Franco Fichtner , FreeBSD Net Subject: Re: CALL FOR TEST axgbe promisc mode Message-ID: References: <31932BD6-8427-4E68-8496-81AADCE9E290@FreeBSD.org> <54063277-FDC6-4B69-914E-08044E09346F@opnsense.org> List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XNFbg2Pmfz4Z5V X-Spamd-Bar: ---- On Mon, Oct 07, 2024 at 10:52:19PM +0800, Zhenlei Huang wrote: > > > > On Oct 2, 2024, at 3:42 PM, Mark Johnston wrote: > > > > On Tue, Oct 01, 2024 at 12:46:07PM +0000, Franco Fichtner wrote: > >> Hi, > >> > >>> On 1. Oct 2024, at 02:47, Zhenlei Huang wrote: > >>> > >>> The test plan is simple, either of the following should suffice: > >>> > >>> • Do traffic sniffing on axgbe interface. The interface will enter promisc mode and should see packets not for us. > >> > >> I tested this with and without the patch and it's inconclusive: > >> > >> 1. tcpdump sees foreign packets with and without patch > >> 2. tcpdump -p sees foreign packets with and without patch > > > > That's somewhat surprising. > > Maybe the firmware / hardware happens to been ( wrongly ) set to promisc mode already ? Maybe, or the driver is missing some initialization step. > >> This oddly enough matches my expectation that nobody raised issues about > >> promisc not working so far, but it leaves the question if we are/I am testing the > >> right thing? > > > > I think you are. BPF uses ifpromisc() to enable promiscuous mode, and > > tcpdump uses that interface rather than setting IFF_PPROMISC directly, > > and without the patch I expect that that's a bit broken. > > > > There is perhaps an unrelated driver bug there. I wonder what flags get > > printed by ifconfig before and during your experiments. It'd also be > > useful to try enabling debug logging (sysctl > > dev.ax.0.axgbe_debug_level=1, I think) to see if axgbe_if_promisc_set() > > is getting executed as expected. > > Probably I should firstly check D46794 in. Any idea ? I have no objection, but it would be good to understand this better. > >> Cheers, > >> Franco > >> > >> ax0: mem 0x80160000-0x8017ffff,0x80140000-0x8015ffff,0x80188000-0x80189fff at device 0.4 on pci6 > >> ax0: Using 512 TX descriptors and 512 RX descriptors > >> ax0: Using 4 RX queues 4 TX queues > >> ax0: Using MSI-X interrupts with 8 vectors > >> ax0: Ethernet address: XX:XX:XX:XX:XX:XX > >> ax0: xgbe_config_sph_mode: SPH disabled in channel 0 > >> ax0: xgbe_config_sph_mode: SPH disabled in channel 1 > >> ax0: xgbe_config_sph_mode: SPH disabled in channel 2 > >> ax0: xgbe_config_sph_mode: SPH disabled in channel 3 > >> ax0: RSS Enabled > >> ax0: Receive checksum offload Enabled > >> ax0: VLAN filtering Enabled > >> ax0: VLAN Stripping Enabled > >> ax0: Checking GPIO expander validity > >> ax0: GPIO configuration valid > >> ax0: SFP detected: > >> ax0: vendor: FS ax0: part number: SFP-10G-T ax0: revision level: A ax0: serial number: XXXXXXXXXXX ax0: netmap queues/slots: TX 4/512, RX 4/512 > >> ax0: Link is UP - 10Gbps/Full - flow control off > >> ax0: link state changed to UP > >> ax0: xgbe_config_sph_mode: SPH disabled in channel 0 > >> ax0: xgbe_config_sph_mode: SPH disabled in channel 1 > >> ax0: xgbe_config_sph_mode: SPH disabled in channel 2 > >> ax0: xgbe_config_sph_mode: SPH disabled in channel 3 > >> ax0: RSS Enabled > >> ax0: Receive checksum offload Disabled > >> ax0: VLAN filtering Disabled > >> ax0: VLAN Stripping Disabled > >> ax0: promiscuous mode enabled > >> ax0: promiscuous mode disabled > > >