From: Vadim Fedorenko <vadim.fedorenko@linux•dev>
To: Yan Jiang <Yan.Jiang@viavisolutions•com>,
"davem@davemloft•net" <davem@davemloft•net>,
"edumazet@google•com" <edumazet@google•com>,
"kuba@kernel•org" <kuba@kernel•org>,
"pabeni@redhat•com" <pabeni@redhat•com>,
"richardcochran@gmail•com" <richardcochran@gmail•com>
Cc: "netdev@vger•kernel.org" <netdev@vger•kernel.org>
Subject: Re: ioctl SIOCSHWTSTAMP failed on a vlan interface within non-default network namespace
Date: Wed, 15 Mar 2023 14:38:37 +0000 [thread overview]
Message-ID: <7e78cd84-17ef-1830-4084-a360d991a619@linux.dev> (raw)
In-Reply-To: <BYAPR18MB240835B708FA3A5B489656738DBF9@BYAPR18MB2408.namprd18.prod.outlook.com>
On 15/03/2023 05:35, Yan Jiang wrote:
> Hi all,
>
> I'd like to report an issue, which I suspect it's related to kernel network namespace handling.
> It's my first report so please bear with me if I missed something. Feel free to ask for more information please.
>
> What's the issue:
> Ptp4l works perfectly on a VLAN interface in default network namespace. But it doesn't work if the VLAN interface is in non-default network namespace: ioctl(fd, SIOCSHWTSTAMP, &ifreq) failed due to error "Operation not supported".
> "ethtool -T" shows that the VLAN interface has all required capabilities. And ptp4l works fine on the base interface in that network namespace.
That was explicitly forbidden in
https://lore.kernel.org/netdev/20190509065507.23991-1-liuhangbin@gmail.com/
> How to reproduce this issue:
> # create a new network namespace for test purpose
> root@viavi-PowerEdge-R740:~# ip netns add mytest
>
> # move eno4 into the namespace
> root@viavi-PowerEdge-R740:~# ip link set eno4 netns mytest
>
> # add vlan interface and turn interfaces up
> root@viavi-PowerEdge-R740:~# ip netns exec mytest ifconfig eno4 up
> root@viavi-PowerEdge-R740:~# ip netns exec mytest ip link add link eno4 name eno4.4000 type vlan id 4000
> root@viavi-PowerEdge-R740:~# ip netns exec mytest ifconfig eno4.4000 up
>
> # ptp4l runs ok on eno4
> root@viavi-PowerEdge-R740:~# ip netns exec mytest ptp4l -2 -m -i eno4
> ptp4l[1670814.457]: selected /dev/ptp1 as PTP clock
> ptp4l[1670814.491]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
> ptp4l[1670814.492]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
>
> #ptp4l cannot run on eno4.4000
> root@viavi-PowerEdge-R740:~# ip netns exec mytest ptp4l -2 -m -i eno4.4000
> ptp4l[1670819.969]: selected /dev/ptp1 as PTP clock
> ptp4l[1670820.003]: driver rejected most general HWTSTAMP filter
> ptp4l[1670820.003]: ioctl SIOCSHWTSTAMP failed: Operation not supported
> ptp4l[1670820.039]: port 1: INITIALIZING to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED)
> ptp4l[1670820.039]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
>
> #ethtool -T shows that eno4.4000 has same capability as eno4:
> root@viavi-PowerEdge-R740:~# ip netns exec mytest ethtool -T eno4.4000
> Time stamping parameters for eno4.4000:
> Capabilities:
> hardware-transmit (SOF_TIMESTAMPING_TX_HARDWARE)
> software-transmit (SOF_TIMESTAMPING_TX_SOFTWARE)
> hardware-receive (SOF_TIMESTAMPING_RX_HARDWARE)
> software-receive (SOF_TIMESTAMPING_RX_SOFTWARE)
> software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
> hardware-raw-clock (SOF_TIMESTAMPING_RAW_HARDWARE)
> PTP Hardware Clock: 1
> Hardware Transmit Timestamp Modes:
> off (HWTSTAMP_TX_OFF)
> on (HWTSTAMP_TX_ON)
> Hardware Receive Filter Modes:
> none (HWTSTAMP_FILTER_NONE)
> ptpv1-l4-event (HWTSTAMP_FILTER_PTP_V1_L4_EVENT)
> ptpv2-l4-event (HWTSTAMP_FILTER_PTP_V2_L4_EVENT)
> ptpv2-l2-event (HWTSTAMP_FILTER_PTP_V2_L2_EVENT)
>
> #OS/kernel version
> root@viavi-PowerEdge-R740:~# uname -a
> Linux viavi-PowerEdge-R740 5.15.0-60-generic #66~20.04.1-Ubuntu SMP Wed Jan 25 09:41:30 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
>
> #driver info:
> root@viavi-PowerEdge-R740:~# ip netns exec mytest ethtool -i eno4
> driver: tg3
> version: 5.15.0-60-generic
> firmware-version: FFV21.40.21 bc 5720-v1.39
> expansion-rom-version:
> bus-info: 0000:01:00.1
> supports-statistics: yes
> supports-test: yes
> supports-eeprom-access: yes
> supports-register-dump: yes
> supports-priv-flags: no
> root@viavi-PowerEdge-R740:~# ip netns exec mytest ethtool -i eno4.4000
> driver: 802.1Q VLAN Support
> version: 1.8
> firmware-version: N/A
> expansion-rom-version:
> bus-info:
> supports-statistics: no
> supports-test: no
> supports-eeprom-access: no
> supports-register-dump: no
> supports-priv-flags: no
>
> #(PS: can reproduce same issue with a Mellanox NIC, so I guess it's not caused by a specific NIC model)
>
> Could you kindly take a look at this and see if this is a kernel issue? This blocks linuxptp running in cloud environment, if VLAN is required.
> Hope to get feedback from you soon, thanks!
>
> /Yan
next prev parent reply other threads:[~2023-03-15 14:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-15 5:35 ioctl SIOCSHWTSTAMP failed on a vlan interface within non-default network namespace Yan Jiang
2023-03-15 14:38 ` Vadim Fedorenko [this message]
[not found] ` <BYAPR18MB2408F4FEDD31152C3C15D5648DBF9@BYAPR18MB2408.namprd18.prod.outlook.com>
2023-03-15 15:56 ` Vadim Fedorenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7e78cd84-17ef-1830-4084-a360d991a619@linux.dev \
--to=vadim.fedorenko@linux$(echo .)dev \
--cc=Yan.Jiang@viavisolutions$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=richardcochran@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox