[Bug 286823] sysutils/intel-pcm Update to 202502 to fix Atom bug with pcm-sensor-server [PATCH]

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 15 May 2025 20:55:42 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286823

            Bug ID: 286823
           Summary: sysutils/intel-pcm Update to 202502 to fix Atom bug
                    with pcm-sensor-server [PATCH]
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: imp@FreeBSD.org
          Reporter: mike@jellydonut.org
          Assignee: imp@FreeBSD.org
             Flags: maintainer-feedback?(imp@FreeBSD.org)

Created attachment 260432
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=260432&action=edit
sysutils/intel-pcm : Update to 202502

The current build of intel-pcm (202405_1) has a bug with the pcm-sensor-server
component as it pertains to Atom-based CPUs (verified on Silvermont and
Goldmont-plus) where the metrics for CPU cores above the first reference the
same core-0 index and are not retrieved correctly in Prometheus:

May 14 17:43:17 <daemon.notice> mon1-dev prometheus[48145]:
ts=2025-05-14T21:43:17.051Z caller=scrape.go:1859 level=debug component="scrape
manager" scrape_pool=pcm target=http://test3:9738/metrics msg="Duplicate sample
for timestamp"
series="Remote_Memory_Bandwidth{socket=\"0\",core=\"0\",thread=\"0\",source=\"core\"}"
May 14 17:43:17 <daemon.notice> mon1-dev prometheus[48145]:
ts=2025-05-14T21:43:17.053Z caller=scrape.go:1820 level=warn component="scrape
manager" scrape_pool=pcm target=http://test3:9738/metrics msg="Error on
ingesting samples with different value but same timestamp" num_dropped=36


The latest upstream version (202502) has fixes for these, so I've updated the
port in my local environment. I've run the patch through poudriere-testport
successfully so submitting it for review. I've tested what components I can
with my limited selection of Intel CPUs (consumer core Sandy Bridge, Haswell,
Skylake and the above Atom Silvermont and Goldmont-plus). pcm, pcm-core,
pcm-latency, pcm-raw, pcm-sensor all work via basic testing, though my primary
use is with pcm-sensor-server.

pcm-sensor-server works and resolved the above bug with Atom-based CPUs but
there's a catch. Upstream added IPv6 support with
https://github.com/intel/pcm/issues/887 and subsequently pcm-sensor-server
appears to only listen to a inet6 socket when started on a dual-stack host.
From my understanding this is RFC2553 compliant so I haven't filed a bug
upstream (and my knowledge of sockets and C in general is limited) as
connectivity does work when net.inet6.ip6.v6only=0 is set via sysctl, which
FreeBSD disables by default from a security perspective. My current workaround
is to set net.inet6.ip6.v6only=0 before starting pcm-sensor-server and then set
it back to 1 when the socket has been opened, which works as expected in my
environment and  now facilitates both v4 and v6 connections.

As I believe this will affect others who use pcm-sensor-server I've added a
package install message detailing the change and my workaround and what I've
found regarding FreeBSD's default settings. If there's better verbage for the
message or a more appropriate fix that would be excellent, but this appears to
at least resolve the situation in my testing.

-- 
You are receiving this mail because:
You are the assignee for the bug.