Sun Ke [Thu, 8 Sep 2022 04:02:26 +0000 (12:02 +0800)]
net: dsa: microchip: lan937x: fix reference count leak in lan937x_mdio_register()
This node pointer is returned by of_find_compatible_node() with
refcount incremented in this function. of_node_put() on it before
exitting this function.
Fixes:
c9cd961c0d43 ("net: dsa: microchip: lan937x: add interrupt support for port phy link")
Signed-off-by: Sun Ke <sunke32@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220908040226.871690-1-sunke32@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Heiner Kallweit [Fri, 9 Sep 2022 06:00:22 +0000 (08:00 +0200)]
r8169: disable detection of chip version 36
I found no evidence that this chip version ever made it to the mass
market. Therefore disable detection. Like in similar cases before:
If nobody complains, we'll remove support for this chip version after
few months.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/ac622d4a-ae0a-3817-710f-849db4015c78@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Gaosheng Cui [Fri, 9 Sep 2022 06:29:59 +0000 (14:29 +0800)]
net: ethernet: remove fs_mii_disconnect and fs_mii_connect declarations
fs_mii_disconnect and fs_mii_connect have been removed since
commit
5b4b8454344a ("[PATCH] FS_ENET: use PAL for mii management"),
so remove them.
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220909062959.1144493-1-cuigaosheng1@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
David S. Miller [Sat, 17 Sep 2022 19:13:41 +0000 (20:13 +0100)]
Merge branch 'octeontx2-cn10k-ptp'
From: Naveen Mamindlapalli <naveenm@marvell.com>
To: <kuba@kernel.org>, <davem@davemloft.net>, <edumazet@google.com>,
<pabeni@redhat.com>, <richardcochran@gmail.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<sgoutham@marvell.com>, <hkelam@marvell.com>
Cc: Naveen Mamindlapalli <naveenm@marvell.com>
Subject: [net-next PATCH 0/4] Add PTP support for CN10K silicon
Date: Sat, 10 Sep 2022 13:24:12 +0530 [thread overview]
Message-ID: <
20220910075416.22887-1-naveenm@marvell.com> (raw)
This patchset adds PTP support for CN10K silicon, specifically
to workaround few hardware issues and to add 1-step mode.
Patchset overview:
Patch #1 returns correct ptp timestamp in nanoseconds captured
when external timestamp event occurs.
Patch #2 adds 1-step mode support.
Patch #3 implements software workaround to generate PPS output properly.
Patch #4 provides a software workaround for the rollover register default
value, which causes ptp to return the wrong timestamp.
====================
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Naveen Mamindlapalli [Sat, 10 Sep 2022 07:54:16 +0000 (13:24 +0530)]
octeontx2-af: Initialize PTP_SEC_ROLLOVER register properly
Since the reset value of PTP_SEC_ROLLOVER is incorrect on
CNF10KB silicon, the ptp timestamps are inaccurate. This
patch initializes the PTP_SEC_ROLLOVER register properly
for the CNF10KB silicon.
Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Naveen Mamindlapalli [Sat, 10 Sep 2022 07:54:15 +0000 (13:24 +0530)]
octeontx2-af: Add PTP PPS Errata workaround on CN10K silicon
Errata:
The ptp_clock_hi rollsover to zero one clock cycle before it
reaches one second boundary. As a result, the pps threshold
comparison fails after one second and the pps output signal
won't toggle further.
This patch workarounds the issue by programming the pps_lo_incr
register to 500msec minus one clock cycle period, ensuring that
the pps threshold comparison succeeds at one second rollover
boundary and pps edge toggles. After that point, the driver will
have enough time (~500msec) to reset the pps threshold value.
After each one second boundary, hrtimer is invoked which resets
the pps threshold value.
Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com>
Signed-off-by: Rakesh Babu Saladi <rsaladi2@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Hariprasad Kelam [Sat, 10 Sep 2022 07:54:14 +0000 (13:24 +0530)]
octeontx2-pf: Add support for ptp 1-step mode on CN10K silicon
Add support for ptp 1-step mode using timecounter. The seconds and
nanoseconds to be updated in PTP header are calculated by adding the
timecounter offset to the free running PTP clock counter time. The PF
driver periodically gets the PTP clock time using AF mbox. The 1-step
support uses HW feature to update correction field rather than
OriginTimestamp field in PTP header.
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Naveen Mamindlapalli [Sat, 10 Sep 2022 07:54:13 +0000 (13:24 +0530)]
octeontx2-af: return correct ptp timestamp for CN10K silicon
The MIO_PTP_TIMESTAMP format has been changed in CN10K silicon
family. The upper 32-bits represents seconds and lower 32-bits
represents nanoseconds. This patch returns nanosecond timestamp
to NIX PF driver.
Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 16 Sep 2022 20:56:27 +0000 (21:56 +0100)]
Merge tag 'linux-can-next-for-6.1-
20220915' of git://git./linux/kernel/git/mkl/linux-can-next
Marc Kleine-Budde says:
====================
Sept. 15, 2022, 8:19 a.m. UTC
Hello Jakub, hello David,
this is a pull request of 23 patches for net-next/master.
the first 2 patches are by me and fix a typo in the rx-offload helper
and the flexcan driver.
Christophe JAILLET's patch cleans up the error handling in
rcar_canfd driver's probe function.
Kenneth Lee's patch converts the kvaser_usb driver from kcalloc() to
kzalloc().
Biju Das contributes 2 patches to the sja1000 driver which update the
DT bindings and support for the RZ/N1 SJA1000 CAN controller.
Jinpeng Cui provides 2 patches that remove redundant variables from
the sja1000 and kvaser_pciefd driver.
2 patches by John Whittington and me add hardware timestamp support to
the gs_usb driver.
Gustavo A. R. Silva's patch converts the etas_es58x driver to make use
of DECLARE_FLEX_ARRAY().
Krzysztof Kozlowski's patch cleans up the sja1000 DT bindings.
Dario Binacchi fixes his invalid email in the flexcan driver
documentation.
Ziyang Xuan contributes 2 patches that clean up the CAN RAW protocol.
Yang Yingliang's patch switches the flexcan driver to dev_err_probe().
The last 7 patches are by Oliver Hartkopp and add support for the next
generation of the CAN protocol: CAN with eXtended data Length (CAN XL).
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Arun Ramadoss [Wed, 7 Sep 2022 07:20:39 +0000 (12:50 +0530)]
net: dsa: microchip: add the support for set_ageing_time
KSZ9477 has the 11 bit ageing count value which is split across the two
registers. And LAN937x has the 20 bit ageing count which is also split
into two registers. Each count in the registers represents 1 second.
This patch add the support for ageing time for KSZ9477 and LAN937x
series of switch.
Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 16 Sep 2022 13:25:17 +0000 (14:25 +0100)]
Merge branch 'net-tc-testing-new-tests'
Zhengchao Shao says:
====================
net: add tc-testing test cases
For this patchset, test cases of the ctinfo, gate, and xt action modules
are added to the tc-testing test suite. Also add deleting test for
connmark, ife, nat, sample and tunnel_key action modules.
After a test case is added locally, the test result is as follows:
./tdc.py -c action ctinfo
considering category action
considering category ctinfo
Test c826: Add ctinfo action with default setting
Test 0286: Add ctinfo action with dscp
Test 4938: Add ctinfo action with valid cpmark and zone
Test 7593: Add ctinfo action with drop control
Test 2961: Replace ctinfo action zone and action control
Test e567: Delete ctinfo action with valid index
Test 6a91: Delete ctinfo action with invalid index
Test 5232: List ctinfo actions
Test 7702: Flush ctinfo actions
Test 3201: Add ctinfo action with duplicate index
Test 8295: Add ctinfo action with invalid index
Test 3964: Replace ctinfo action with invalid goto_chain control
All test results:
1..12
ok 1 c826 - Add ctinfo action with default setting
ok 2 0286 - Add ctinfo action with dscp
ok 3 4938 - Add ctinfo action with valid cpmark and zone
ok 4 7593 - Add ctinfo action with drop control
ok 5 2961 - Replace ctinfo action zone and action control
ok 6 e567 - Delete ctinfo action with valid index
ok 7 6a91 - Delete ctinfo action with invalid index
ok 8 5232 - List ctinfo actions
ok 9 7702 - Flush ctinfo actions
ok 10 3201 - Add ctinfo action with duplicate index
ok 11 8295 - Add ctinfo action with invalid index
ok 12 3964 - Replace ctinfo action with invalid goto_chain control
./tdc.py -c action gate
considering category gate
considering category action
Test 5153: Add gate action with priority and sched-entry
Test 7189: Add gate action with base-time
Test a721: Add gate action with cycle-time
Test c029: Add gate action with cycle-time-ext
Test 3719: Replace gate base-time action
Test d821: Delete gate action with valid index
Test 3128: Delete gate action with invalid index
Test 7837: List gate actions
Test 9273: Flush gate actions
Test c829: Add gate action with duplicate index
Test 3043: Add gate action with invalid index
Test 2930: Add gate action with cookie
All test results:
1..12
ok 1 5153 - Add gate action with priority and sched-entry
ok 2 7189 - Add gate action with base-time
ok 3 a721 - Add gate action with cycle-time
ok 4 c029 - Add gate action with cycle-time-ext
ok 5 3719 - Replace gate base-time action
ok 6 d821 - Delete gate action with valid index
ok 7 3128 - Delete gate action with invalid index
ok 8 7837 - List gate actions
ok 9 9273 - Flush gate actions
ok 10 c829 - Add gate action with duplicate index
ok 11 3043 - Add gate action with invalid index
ok 12 2930 - Add gate action with cookie
./tdc.py -c action xt
considering category xt
considering category action
Test 2029: Add xt action with log-prefix
Test 3562: Replace xt action log-prefix
Test 8291: Delete xt action with valid index
Test 5169: Delete xt action with invalid index
Test 7284: List xt actions
Test 5010: Flush xt actions
Test 8437: Add xt action with duplicate index
Test 2837: Add xt action with invalid index
All test results:
1..8
ok 1 2029 - Add xt action with log-prefix
ok 2 3562 - Replace xt action log-prefix
ok 3 8291 - Delete xt action with valid index
ok 4 5169 - Delete xt action with invalid index
ok 5 7284 - List xt actions
ok 6 5010 - Flush xt actions
ok 7 8437 - Add xt action with duplicate index
ok 8 2837 - Add xt action with invalid index
./tdc.py -c action connmark
considering category action
considering category connmark
Test 2002: Add valid connmark action with defaults
Test 56a5: Add valid connmark action with control pass
Test 7c66: Add valid connmark action with control drop
Test a913: Add valid connmark action with control pipe
Test bdd8: Add valid connmark action with control reclassify
Test b8be: Add valid connmark action with control continue
Test d8a6: Add valid connmark action with control jump
Test aae8: Add valid connmark action with zone argument
Test 2f0b: Add valid connmark action with invalid zone argument
Test 9305: Add connmark action with unsupported argument
Test 71ca: Add valid connmark action and replace it
Test 5f8f: Add valid connmark action with cookie
Test c506: Replace connmark with invalid goto chain control
Test 6571: Delete connmark action with valid index
Test 3426: Delete connmark action with invalid index
All test results:
1..15
ok 1 2002 - Add valid connmark action with defaults
ok 2 56a5 - Add valid connmark action with control pass
ok 3 7c66 - Add valid connmark action with control drop
ok 4 a913 - Add valid connmark action with control pipe
ok 5 bdd8 - Add valid connmark action with control reclassify
ok 6 b8be - Add valid connmark action with control continue
ok 7 d8a6 - Add valid connmark action with control jump
ok 8 aae8 - Add valid connmark action with zone argument
ok 9 2f0b - Add valid connmark action with invalid zone argument
ok 10 9305 - Add connmark action with unsupported argument
ok 11 71ca - Add valid connmark action and replace it
ok 12 5f8f - Add valid connmark action with cookie
ok 13 c506 - Replace connmark with invalid goto chain control
ok 14 6571 - Delete connmark action with valid index
ok 15 3426 - Delete connmark action with invalid index
./tdc.py -c action ife
considering category action
considering category ife
Test 7682: Create valid ife encode action with mark and pass control
Test ef47: Create valid ife encode action with mark and pipe control
Test df43: Create valid ife encode action with mark and continue control
Test e4cf: Create valid ife encode action with mark and drop control
Test ccba: Create valid ife encode action with mark and reclassify control
Test a1cf: Create valid ife encode action with mark and jump control
Test cb3d: Create valid ife encode action with mark value at 32-bit
maximum
Test 1efb: Create ife encode action with mark value exceeding 32-bit
maximum
Test 95ed: Create valid ife encode action with prio and pass control
Test aa17: Create valid ife encode action with prio and pipe control
Test 74c7: Create valid ife encode action with prio and continue control
Test 7a97: Create valid ife encode action with prio and drop control
Test f66b: Create valid ife encode action with prio and reclassify control
Test 3056: Create valid ife encode action with prio and jump control
Test 7dd3: Create valid ife encode action with prio value at 32-bit
maximum
Test 2ca1: Create ife encode action with prio value exceeding 32-bit
maximum
Test 05bb: Create valid ife encode action with tcindex and pass control
Test ce65: Create valid ife encode action with tcindex and pipe control
Test 09cd: Create valid ife encode action with tcindex and continue control
Test 8eb5: Create valid ife encode action with tcindex and continue control
Test 451a: Create valid ife encode action with tcindex and drop control
Test d76c: Create valid ife encode action with tcindex and reclassify
control
Test e731: Create valid ife encode action with tcindex and jump control
Test b7b8: Create valid ife encode action with tcindex value at 16-bit
maximum
Test d0d8: Create ife encode action with tcindex value exceeding 16-bit
maximum
Test 2a9c: Create valid ife encode action with mac src parameter
Test cf5c: Create valid ife encode action with mac dst parameter
Test 2353: Create valid ife encode action with mac src and mac dst
parameters
Test 552c: Create valid ife encode action with mark and type parameters
Test 0421: Create valid ife encode action with prio and type parameters
Test 4017: Create valid ife encode action with tcindex and type parameters
Test fac3: Create valid ife encode action with index at 32-bit maximum
Test 7c25: Create valid ife decode action with pass control
Test dccb: Create valid ife decode action with pipe control
Test 7bb9: Create valid ife decode action with continue control
Test d9ad: Create valid ife decode action with drop control
Test 219f: Create valid ife decode action with reclassify control
Test 8f44: Create valid ife decode action with jump control
Test 56cf: Create ife encode action with index exceeding 32-bit maximum
Test ee94: Create ife encode action with invalid control
Test b330: Create ife encode action with cookie
Test bbc0: Create ife encode action with invalid argument
Test d54a: Create ife encode action with invalid type argument
Test 7ee0: Create ife encode action with invalid mac src argument
Test 0a7d: Create ife encode action with invalid mac dst argument
Test a0e2: Replace ife encode action with invalid goto chain control
Test a972: Delete ife encode action with valid index
Test 1272: Delete ife encode action with invalid index
All test results:
1..48
ok 1 7682 - Create valid ife encode action with mark and pass control
ok 2 ef47 - Create valid ife encode action with mark and pipe control
ok 3 df43 - Create valid ife encode action with mark and continue control
ok 4 e4cf - Create valid ife encode action with mark and drop control
ok 5 ccba - Create valid ife encode action with mark and reclassify
control
ok 6 a1cf - Create valid ife encode action with mark and jump control
ok 7 cb3d - Create valid ife encode action with mark value at 32-bit
maximum
ok 8 1efb - Create ife encode action with mark value exceeding 32-bit
maximum
ok 9 95ed - Create valid ife encode action with prio and pass control
ok 10 aa17 - Create valid ife encode action with prio and pipe control
ok 11 74c7 - Create valid ife encode action with prio and continue control
ok 12 7a97 - Create valid ife encode action with prio and drop control
ok 13 f66b - Create valid ife encode action with prio and reclassify
control
ok 14 3056 - Create valid ife encode action with prio and jump control
ok 15 7dd3 - Create valid ife encode action with prio value at 32-bit
maximum
ok 16 2ca1 - Create ife encode action with prio value exceeding 32-bit
maximum
ok 17 05bb - Create valid ife encode action with tcindex and pass control
ok 18 ce65 - Create valid ife encode action with tcindex and pipe control
ok 19 09cd - Create valid ife encode action with tcindex and continue
control
ok 20 8eb5 - Create valid ife encode action with tcindex and continue
control
ok 21 451a - Create valid ife encode action with tcindex and drop control
ok 22 d76c - Create valid ife encode action with tcindex and reclassify
control
ok 23 e731 - Create valid ife encode action with tcindex and jump control
ok 24 b7b8 - Create valid ife encode action with tcindex value at 16-bit
maximum
ok 25 d0d8 - Create ife encode action with tcindex value exceeding 16-bit
maximum
ok 26 2a9c - Create valid ife encode action with mac src parameter
ok 27 cf5c - Create valid ife encode action with mac dst parameter
ok 28 2353 - Create valid ife encode action with mac src and mac dst
parameters
ok 29 552c - Create valid ife encode action with mark and type parameters
ok 30 0421 - Create valid ife encode action with prio and type parameters
ok 31 4017 - Create valid ife encode action with tcindex and type
parameters
ok 32 fac3 - Create valid ife encode action with index at 32-bit maximum
ok 33 7c25 - Create valid ife decode action with pass control
ok 34 dccb - Create valid ife decode action with pipe control
ok 35 7bb9 - Create valid ife decode action with continue control
ok 36 d9ad - Create valid ife decode action with drop control
ok 37 219f - Create valid ife decode action with reclassify control
ok 38 8f44 - Create valid ife decode action with jump control
ok 39 56cf - Create ife encode action with index exceeding 32-bit maximum
ok 40 ee94 - Create ife encode action with invalid control
ok 41 b330 - Create ife encode action with cookie
ok 42 bbc0 - Create ife encode action with invalid argument
ok 43 d54a - Create ife encode action with invalid type argument
ok 44 7ee0 - Create ife encode action with invalid mac src argument
ok 45 0a7d - Create ife encode action with invalid mac dst argument
ok 46 a0e2 - Replace ife encode action with invalid goto chain control
ok 47 a972 - Delete ife encode action with valid index
ok 48 1272 - Delete ife encode action with invalid index
./tdc.py -c action nat
considering category action
considering category nat
Test 7565: Add nat action on ingress with default control action
Test fd79: Add nat action on ingress with pipe control action
Test eab9: Add nat action on ingress with continue control action
Test c53a: Add nat action on ingress with reclassify control action
Test 76c9: Add nat action on ingress with jump control action
Test 24c6: Add nat action on ingress with drop control action
Test 2120: Add nat action on ingress with maximum index value
Test 3e9d: Add nat action on ingress with invalid index value
Test f6c9: Add nat action on ingress with invalid IP address
Test be25: Add nat action on ingress with invalid argument
Test a7bd: Add nat action on ingress with DEFAULT IP address
Test ee1e: Add nat action on ingress with ANY IP address
Test 1de8: Add nat action on ingress with ALL IP address
Test 8dba: Add nat action on egress with default control action
Test 19a7: Add nat action on egress with pipe control action
Test f1d9: Add nat action on egress with continue control action
Test 6d4a: Add nat action on egress with reclassify control action
Test b313: Add nat action on egress with jump control action
Test d9fc: Add nat action on egress with drop control action
Test a895: Add nat action on egress with DEFAULT IP address
Test 2572: Add nat action on egress with ANY IP address
Test 37f3: Add nat action on egress with ALL IP address
Test 6054: Add nat action on egress with cookie
Test 79d6: Add nat action on ingress with cookie
Test 4b12: Replace nat action with invalid goto chain control
Test b811: Delete nat action with valid index
Test a521: Delete nat action with invalid index
All test results:
1..27
ok 1 7565 - Add nat action on ingress with default control action
ok 2 fd79 - Add nat action on ingress with pipe control action
ok 3 eab9 - Add nat action on ingress with continue control action
ok 4 c53a - Add nat action on ingress with reclassify control action
ok 5 76c9 - Add nat action on ingress with jump control action
ok 6 24c6 - Add nat action on ingress with drop control action
ok 7 2120 - Add nat action on ingress with maximum index value
ok 8 3e9d - Add nat action on ingress with invalid index value
ok 9 f6c9 - Add nat action on ingress with invalid IP address
ok 10 be25 - Add nat action on ingress with invalid argument
ok 11 a7bd - Add nat action on ingress with DEFAULT IP address
ok 12 ee1e - Add nat action on ingress with ANY IP address
ok 13 1de8 - Add nat action on ingress with ALL IP address
ok 14 8dba - Add nat action on egress with default control action
ok 15 19a7 - Add nat action on egress with pipe control action
ok 16 f1d9 - Add nat action on egress with continue control action
ok 17 6d4a - Add nat action on egress with reclassify control action
ok 18 b313 - Add nat action on egress with jump control action
ok 19 d9fc - Add nat action on egress with drop control action
ok 20 a895 - Add nat action on egress with DEFAULT IP address
ok 21 2572 - Add nat action on egress with ANY IP address
ok 22 37f3 - Add nat action on egress with ALL IP address
ok 23 6054 - Add nat action on egress with cookie
ok 24 79d6 - Add nat action on ingress with cookie
ok 25 4b12 - Replace nat action with invalid goto chain control
ok 26 b811 - Delete nat action with valid index
ok 27 a521 - Delete nat action with invalid index
./tdc.py -c action sample
considering category action
considering category sample
Test 9784: Add valid sample action with mandatory arguments
Test 5c91: Add valid sample action with mandatory arguments and continue
control action
Test 334b: Add valid sample action with mandatory arguments and drop
control action
Test da69: Add valid sample action with mandatory arguments and reclassify
control action
Test 13ce: Add valid sample action with mandatory arguments and pipe
control action
Test 1886: Add valid sample action with mandatory arguments and jump
control action
Test 7571: Add sample action with invalid rate
Test b6d4: Add sample action with mandatory arguments and invalid control
action
Test a874: Add invalid sample action without mandatory arguments
Test ac01: Add invalid sample action without mandatory argument rate
Test 4203: Add invalid sample action without mandatory argument group
Test 14a7: Add invalid sample action without mandatory argument group
Test 8f2e: Add valid sample action with trunc argument
Test 45f8: Add sample action with maximum rate argument
Test ad0c: Add sample action with maximum trunc argument
Test 83a9: Add sample action with maximum group argument
Test ed27: Add sample action with invalid rate argument
Test 2eae: Add sample action with invalid group argument
Test 6ff3: Add sample action with invalid trunc size
Test 2b2a: Add sample action with invalid index
Test dee2: Add sample action with maximum allowed index
Test 560e: Add sample action with cookie
Test 704a: Replace existing sample action with new rate argument
Test 60eb: Replace existing sample action with new group argument
Test 2cce: Replace existing sample action with new trunc argument
Test 59d1: Replace existing sample action with new control argument
Test 0a6e: Replace sample action with invalid goto chain control
Test 3872: Delete sample action with valid index
Test a394: Delete sample action with invalid index
All test results:
1..29
ok 1 9784 - Add valid sample action with mandatory arguments
ok 2 5c91 - Add valid sample action with mandatory arguments and continue
control action
ok 3 334b - Add valid sample action with mandatory arguments and drop
control action
ok 4 da69 - Add valid sample action with mandatory arguments and
reclassify control action
ok 5 13ce - Add valid sample action with mandatory arguments and pipe
control action
ok 6 1886 - Add valid sample action with mandatory arguments and jump
control action
ok 7 7571 - Add sample action with invalid rate
ok 8 b6d4 - Add sample action with mandatory arguments and invalid control
action
ok 9 a874 - Add invalid sample action without mandatory arguments
ok 10 ac01 - Add invalid sample action without mandatory argument rate
ok 11 4203 - Add invalid sample action without mandatory argument group
ok 12 14a7 - Add invalid sample action without mandatory argument group
ok 13 8f2e - Add valid sample action with trunc argument
ok 14 45f8 - Add sample action with maximum rate argument
ok 15 ad0c - Add sample action with maximum trunc argument
ok 16 83a9 - Add sample action with maximum group argument
ok 17 ed27 - Add sample action with invalid rate argument
ok 18 2eae - Add sample action with invalid group argument
ok 19 6ff3 - Add sample action with invalid trunc size
ok 20 2b2a - Add sample action with invalid index
ok 21 dee2 - Add sample action with maximum allowed index
ok 22 560e - Add sample action with cookie
ok 23 704a - Replace existing sample action with new rate argument
ok 24 60eb - Replace existing sample action with new group argument
ok 25 2cce - Replace existing sample action with new trunc argument
ok 26 59d1 - Replace existing sample action with new control argument
ok 27 0a6e - Replace sample action with invalid goto chain control
ok 28 3872 - Delete sample action with valid index
ok 29 a394 - Delete sample action with invalid index
./tdc.py -c action tunnel_key
considering category tunnel_key
considering category action
Test 2b11: Add tunnel_key set action with mandatory parameters
Test dc6b: Add tunnel_key set action with missing mandatory src_ip
parameter
Test 7f25: Add tunnel_key set action with missing mandatory dst_ip
parameter
Test a5e0: Add tunnel_key set action with invalid src_ip parameter
Test eaa8: Add tunnel_key set action with invalid dst_ip parameter
Test 3b09: Add tunnel_key set action with invalid id parameter
Test 9625: Add tunnel_key set action with invalid dst_port parameter
Test 05af: Add tunnel_key set action with optional dst_port parameter
Test da80: Add tunnel_key set action with index at 32-bit maximum
Test d407: Add tunnel_key set action with index exceeding 32-bit maximum
Test 5cba: Add tunnel_key set action with id value at 32-bit maximum
Test e84a: Add tunnel_key set action with id value exceeding 32-bit
maximum
Test 9c19: Add tunnel_key set action with dst_port value at 16-bit maximum
Test 3bd9: Add tunnel_key set action with dst_port value exceeding 16-bit
maximum
Test 68e2: Add tunnel_key unset action
Test 6192: Add tunnel_key unset continue action
Test 061d: Add tunnel_key set continue action with cookie
Test 8acb: Add tunnel_key set continue action with invalid cookie
Test a07e: Add tunnel_key action with no set/unset command specified
Test b227: Add tunnel_key action with csum option
Test 58a7: Add tunnel_key action with nocsum option
Test 2575: Add tunnel_key action with not-supported parameter
Test 7a88: Add tunnel_key action with cookie parameter
Test 4f20: Add tunnel_key action with a single geneve option parameter
Test e33d: Add tunnel_key action with multiple geneve options parameter
Test 0778: Add tunnel_key action with invalid class geneve option
parameter
Test 4ae8: Add tunnel_key action with invalid type geneve option parameter
Test 4039: Add tunnel_key action with short data length geneve option
parameter
Test 26a6: Add tunnel_key action with non-multiple of 4 data length geneve
option parameter
Test f44d: Add tunnel_key action with incomplete geneve options parameter
Test 7afc: Replace tunnel_key set action with all parameters
Test 364d: Replace tunnel_key set action with all parameters and cookie
Test 937c: Fetch all existing tunnel_key actions
Test 6783: Flush all existing tunnel_key actions
Test 8242: Replace tunnel_key set action with invalid goto chain
Test 0cd2: Add tunnel_key set action with no_percpu flag
Test 3671: Delete tunnel_key set action with valid index
Test 8597: Delete tunnel_key set action with invalid index
All test results:
1..38
ok 1 2b11 - Add tunnel_key set action with mandatory parameters
ok 2 dc6b - Add tunnel_key set action with missing mandatory src_ip
parameter
ok 3 7f25 - Add tunnel_key set action with missing mandatory dst_ip
parameter
ok 4 a5e0 - Add tunnel_key set action with invalid src_ip parameter
ok 5 eaa8 - Add tunnel_key set action with invalid dst_ip parameter
ok 6 3b09 - Add tunnel_key set action with invalid id parameter
ok 7 9625 - Add tunnel_key set action with invalid dst_port parameter
ok 8 05af - Add tunnel_key set action with optional dst_port parameter
ok 9 da80 - Add tunnel_key set action with index at 32-bit maximum
ok 10 d407 - Add tunnel_key set action with index exceeding 32-bit maximum
ok 11 5cba - Add tunnel_key set action with id value at 32-bit maximum
ok 12 e84a - Add tunnel_key set action with id value exceeding 32-bit
maximum
ok 13 9c19 - Add tunnel_key set action with dst_port value at 16-bit
maximum
ok 14 3bd9 - Add tunnel_key set action with dst_port value exceeding
16-bit maximum
ok 15 68e2 - Add tunnel_key unset action
ok 16 6192 - Add tunnel_key unset continue action
ok 17 061d - Add tunnel_key set continue action with cookie
ok 18 8acb - Add tunnel_key set continue action with invalid cookie
ok 19 a07e - Add tunnel_key action with no set/unset command specified
ok 20 b227 - Add tunnel_key action with csum option
ok 21 58a7 - Add tunnel_key action with nocsum option
ok 22 2575 - Add tunnel_key action with not-supported parameter
ok 23 7a88 - Add tunnel_key action with cookie parameter
ok 24 4f20 - Add tunnel_key action with a single geneve option parameter
ok 25 e33d - Add tunnel_key action with multiple geneve options parameter
ok 26 0778 - Add tunnel_key action with invalid class geneve option
parameter
ok 27 4ae8 - Add tunnel_key action with invalid type geneve option
parameter
ok 28 4039 - Add tunnel_key action with short data length geneve option
parameter
ok 29 26a6 - Add tunnel_key action with non-multiple of 4 data length
geneve option parameter
ok 30 f44d - Add tunnel_key action with incomplete geneve options
parameter
ok 31 7afc - Replace tunnel_key set action with all parameters
ok 32 364d - Replace tunnel_key set action with all parameters and cookie
ok 33 937c - Fetch all existing tunnel_key actions
ok 34 6783 - Flush all existing tunnel_key actions
ok 35 8242 - Replace tunnel_key set action with invalid goto chain
ok 36 0cd2 - Add tunnel_key set action with no_percpu flag
ok 37 3671 - Delete tunnel_key set action with valid index
ok 38 8597 - Delete tunnel_key set action with invalid index
====================
Reviewed-by: Victor Nogueira <victor@mojatatu.com>
Tested-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Fri, 9 Sep 2022 01:29:36 +0000 (09:29 +0800)]
selftests/tc-testings: add tunnel_key action deleting test case
Test 3671: Delete tunnel_key set action with valid index
Test 8597: Delete tunnel_key set action with invalid index
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Fri, 9 Sep 2022 01:29:35 +0000 (09:29 +0800)]
selftests/tc-testings: add sample action deleting test case
Test 3872: Delete sample action with valid index
Test a394: Delete sample action with invalid index
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Fri, 9 Sep 2022 01:29:34 +0000 (09:29 +0800)]
selftests/tc-testings: add nat action deleting test case
Test b811: Delete nat action with valid index
Test a521: Delete nat action with invalid index
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Fri, 9 Sep 2022 01:29:33 +0000 (09:29 +0800)]
selftests/tc-testings: add ife action deleting test case
Test a972: Delete ife encode action with valid index
Test 1272: Delete ife encode action with invalid index
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Fri, 9 Sep 2022 01:29:32 +0000 (09:29 +0800)]
selftests/tc-testings: add connmark action deleting test case
Test 6571: Delete connmark action with valid index
Test 3426: Delete connmark action with invalid index
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Fri, 9 Sep 2022 01:29:31 +0000 (09:29 +0800)]
selftests/tc-testings: add selftests for xt action
Test 2029: Add xt action with log-prefix
Test 3562: Replace xt action log-prefix
Test 8291: Delete xt action with valid index
Test 5169: Delete xt action with invalid index
Test 7284: List xt actions
Test 5010: Flush xt actions
Test 8437: Add xt action with duplicate index
Test 2837: Add xt action with invalid index
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Fri, 9 Sep 2022 01:29:30 +0000 (09:29 +0800)]
selftests/tc-testings: add selftests for gate action
Test 5153: Add gate action with priority and sched-entry
Test 7189: Add gate action with base-time
Test a721: Add gate action with cycle-time
Test c029: Add gate action with cycle-time-ext
Test 3719: Replace gate base-time action
Test d821: Delete gate action with valid index
Test 3128: Delete gate action with invalid index
Test 7837: List gate actions
Test 9273: Flush gate actions
Test c829: Add gate action with duplicate index
Test 3043: Add gate action with invalid index
Test 2930: Add gate action with cookie
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Fri, 9 Sep 2022 01:29:29 +0000 (09:29 +0800)]
selftests/tc-testings: add selftests for ctinfo action
Test c826: Add ctinfo action with default setting
Test 0286: Add ctinfo action with dscp
Test 4938: Add ctinfo action with valid cpmark and zone
Test 7593: Add ctinfo action with drop control
Test 2961: Replace ctinfo action zone and action control
Test e567: Delete ctinfo action with valid index
Test 6a91: Delete ctinfo action with invalid index
Test 5232: List ctinfo actions
Test 7702: Flush ctinfo actions
Test 3201: Add ctinfo action with duplicate index
Test 8295: Add ctinfo action with invalid index
Test 3964: Replace ctinfo action with invalid goto_chain control
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 16 Sep 2022 11:15:15 +0000 (12:15 +0100)]
Merge branch '1GbE' of git://git./linux/kernel/git/tnguy/next-queue
Tony Nguyen says:
====================
Intel Wired LAN Driver Updates 2022-09-08 (e1000e, igc)
This series contains updates to e1000e and igc drivers.
Li Zhong adds checking and handling for failed PHY register reads for
e1000e.
Sasha removes an unused define for igc.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Zheng Yongjun [Thu, 8 Sep 2022 13:55:13 +0000 (13:55 +0000)]
net: fs_enet: Fix wrong check in do_pd_setup
Should check of_iomap return value 'fep->fec.fecp' instead of 'fep->fcc.fccp'
Fixes:
976de6a8c304 ("fs_enet: Be an of_platform device when CONFIG_PPC_CPM_NEW_BINDING is set.")
Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
wangjianli [Thu, 8 Sep 2022 12:43:50 +0000 (20:43 +0800)]
mellanox/mlxsw: fix repeated words in comments
Delete the redundant word 'in'.
Signed-off-by: wangjianli <wangjianli@cdjrlc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Dan Carpenter [Thu, 8 Sep 2022 12:20:23 +0000 (15:20 +0300)]
iov_iter: use "maxpages" parameter
This was intended to be "maxpages" instead of INT_MAX. There is only
one caller and it passes INT_MAX so this does not affect runtime.
Fixes:
b93235e68921 ("tls: cap the output scatter list to something reasonable")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 16 Sep 2022 09:27:47 +0000 (10:27 +0100)]
Merge branch 'net-amd-static-checker-warnings'
Haoyue Xu says:
====================
net: amd: Cleanup for clearing static warnings
Most static warnings are detected by tools, mainly about:
(1) #1: About the if stament.
(2) #2: About the spelling.
(2) #3: About the indent.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Guofeng Yue [Wed, 7 Sep 2022 06:28:12 +0000 (14:28 +0800)]
net: amd: Switch and case should be at the same indent
Cleaning some static warnings of indent.
Signed-off-by: Guofeng Yue <yueguofeng@hisilicon.com>
Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Guofeng Yue [Wed, 7 Sep 2022 06:28:11 +0000 (14:28 +0800)]
net: amd: Correct spelling errors
Find some spelling errors:
interupts --> interrupts
lenth --> length
stoped --> stopped
contoller --> controller
Signed-off-by: Guofeng Yue <yueguofeng@hisilicon.com>
Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Guofeng Yue [Wed, 7 Sep 2022 06:28:10 +0000 (14:28 +0800)]
net: amd: Unified the comparison between pointers and NULL to the same writing
Using the unified way to compare pointers and NULL, which cleans the static
warning.
eg:
if (skb == NULL) --> if (!skb)
if (skb != NULL) --> if (skb)
Signed-off-by: Guofeng Yue <yueguofeng@hisilicon.com>
Signed-off-by: Haoyue Xu <xuhaoyue1@hisilicon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jilin Yuan [Wed, 7 Sep 2022 04:01:31 +0000 (12:01 +0800)]
vsock/vmci: fix repeated words in comments
Delete the redundant word 'that'.
Signed-off-by: Jilin Yuan <yuanjilin@cdjrlc.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Nicolas Dichtel [Tue, 6 Sep 2022 09:55:58 +0000 (11:55 +0200)]
rtnetlink: advertise allmulti counter
Like what was done with IFLA_PROMISCUITY, add IFLA_ALLMULTI to advertise
the allmulti counter.
The flag IFF_ALLMULTI is advertised only if it was directly set by a
userland app.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Wei Fang [Tue, 6 Sep 2022 08:39:23 +0000 (16:39 +0800)]
net: fec: add pm runtime force suspend and resume support
Force mii bus into runtime pm suspend state during device suspends,
since phydev state is already PHY_HALTED, and there is no need to
access mii bus during device suspend state. Then force mii bus into
runtime pm resume state when device resumes.
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Paolo Abeni [Thu, 15 Sep 2022 10:41:42 +0000 (12:41 +0200)]
Merge branch 'net-ftgmac100-support-fixed-link'
Tao Ren says:
====================
net: ftgmac100: support fixed link
The patch series adds fixed link support to ftgmac100 driver.
Patch #1 adds fixed link logic into ftgmac100 driver.
Patch #2 enables mac3 controller in Elbert dts: Elbert mac3 is connected
to the onboard switch BCM53134P's IMP_RGMII port directly (no PHY
between BMC MAC and BCM53134P).
====================
Link: https://lore.kernel.org/r/20220907054453.20016-1-rentao.bupt@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Tao Ren [Wed, 7 Sep 2022 05:44:53 +0000 (22:44 -0700)]
ARM: dts: aspeed: elbert: Enable mac3 controller
Enable mac3 controller in Elbert dts: Elbert MAC3 is connected to the
BCM53134P onboard switch's IMP_RGMII port directly (fixed link, no PHY
between BMC MAC and BCM53134P).
Note: BMC's mdio0 controller is connected to BCM53134P's MDIO interface,
and the MDIO channel will be enabled later, when BCM53134 is added to
"bcm53xx" DSA driver.
Signed-off-by: Tao Ren <rentao.bupt@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Tao Ren [Wed, 7 Sep 2022 05:44:52 +0000 (22:44 -0700)]
net: ftgmac100: support fixed link
Support fixed link in ftgmac100 driver. Fixed link is used on several
Meta OpenBMC platforms, such as Elbert (AST2620) and Wedge400 (AST2520).
Signed-off-by: Tao Ren <rentao.bupt@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Paolo Abeni [Thu, 15 Sep 2022 10:01:04 +0000 (12:01 +0200)]
Merge branch 'mptcp-allow-privileged-operations-from-user-ns-cleanup'
Matthieu Baerts says:
====================
mptcp: allow privileged operations from user ns & cleanup
This series allows privileged Netlink operations from user namespaces. When a
non-root user configures MPTCP endpoints, the memory allocation is now accounted
to this user. See patches 4 and 5.
Apart from that, there are some cleanup:
- Patch 1 adds a macro to improve code readability
- Patch 2 regroups similar checks all together
- Patch 3 uses an explicit boolean instead of a counter to do one more check
====================
Link: https://lore.kernel.org/r/20220906205545.1623193-1-matthieu.baerts@tessares.net
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Thomas Haller [Tue, 6 Sep 2022 20:55:43 +0000 (22:55 +0200)]
mptcp: account memory allocation in mptcp_nl_cmd_add_addr() to user
Now that non-root users can configure MPTCP endpoints, account
the memory allocation to the user.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Thomas Haller [Tue, 6 Sep 2022 20:55:42 +0000 (22:55 +0200)]
mptcp: allow privileged operations from user namespaces
GENL_ADMIN_PERM checks that the user has CAP_NET_ADMIN in the initial
namespace by calling netlink_capable(). Instead, use GENL_UNS_ADMIN_PERM
which uses netlink_ns_capable(). This checks that the caller has
CAP_NET_ADMIN in the current user namespace.
See also
commit
4a92602aa1cd ("openvswitch: allow management from inside user namespaces")
which introduced this mechanism. See also
commit
5617c6cd6f84 ("nl80211: Allow privileged operations from user namespaces")
which introduced this for nl80211.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Geliang Tang [Tue, 6 Sep 2022 20:55:41 +0000 (22:55 +0200)]
mptcp: add do_check_data_fin to replace copied
This patch adds a new bool variable 'do_check_data_fin' to replace the
original int variable 'copied' in __mptcp_push_pending(), check it to
determine whether to call __mptcp_check_send_data_fin().
Suggested-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Geliang Tang [Tue, 6 Sep 2022 20:55:40 +0000 (22:55 +0200)]
selftests: mptcp: move prefix tests of addr_nr_ns2 together
Move the fullmesh prefix test of addr_nr_ns2 together with its other
prefix tests.
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Matthieu Baerts [Tue, 6 Sep 2022 20:55:39 +0000 (22:55 +0200)]
mptcp: add mptcp_for_each_subflow_safe helper
Similar to mptcp_for_each_subflow(): this is clearer now that the _safe
version is used in multiple places.
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Dmitry Torokhov [Tue, 6 Sep 2022 20:49:22 +0000 (13:49 -0700)]
net: phy: spi_ks8895: switch to using gpiod API
This patch switches the driver away from legacy gpio/of_gpio API to
gpiod API, and removes use of of_get_named_gpio_flags() which I want to
make private to gpiolib.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220906204922.3789922-3-dmitry.torokhov@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Dmitry Torokhov [Tue, 6 Sep 2022 20:49:21 +0000 (13:49 -0700)]
net: ks8851: switch to using gpiod API
This patch switches the driver away from legacy gpio/of_gpio API to
gpiod API, and removes use of of_get_named_gpio_flags() which I want to
make private to gpiolib.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220906204922.3789922-2-dmitry.torokhov@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Dmitry Torokhov [Tue, 6 Sep 2022 20:49:20 +0000 (13:49 -0700)]
net: davicom: dm9000: switch to using gpiod API
This patch switches the driver away from legacy gpio/of_gpio API to
gpiod API, and removes use of of_get_named_gpio_flags() which I want to
make private to gpiolib.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220906204922.3789922-1-dmitry.torokhov@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Marc Kleine-Budde [Thu, 15 Sep 2022 07:13:31 +0000 (09:13 +0200)]
Merge patch series "can: support CAN XL"
Oliver Hartkopp <socketcan@hartkopp.net> says:
The CAN with eXtended data Length (CAN XL) is a new CAN protocol with
a 10Mbit/s data transfer with a new physical layer transceiver (for
this data section). CAN XL allows up to 2048 byte of payload and
shares the arbitration principle (11 bit priority) known from
Classical CAN and CAN FD. RTR and 29 bit identifiers are not
implemented in CAN XL.
A short introduction to CAN XL can be found here:
https://www.can-cia.org/can-knowledge/can/can-xl/
https://github.com/linux-can/can-doc/blob/master/presentations/CAN-XL-Intro.pdf
V1: https://lore.kernel.org/all/
20220711183426.96446-1-socketcan@hartkopp.net
V2: Major rework after discussion and feedback on Linux-CAN ML
https://lore.kernel.org/all/
20220714160541.2071-1-socketcan@hartkopp.net
- rework of struct canxl_frame
- CANXL_XLF flag is now the switch between CAN XL and CAN/CANFD
- variable length in r/w operations for CAN XL frames
- write CAN XL frame to raw socket enforces size <-> canxl_frame.len sync
V3: Fix length for CAN XL frames inside the sk_buff
https://lore.kernel.org/all/
20220717132730.30295-1-socketcan@hartkopp.net
- extend the CAN_RAW sockopt to handle fixed/truncated read/write operations
V4: Fix patch 5 (can: raw: add CAN XL support)
https://lore.kernel.org/all/
20220719054204.29061-1-socketcan@hartkopp.net
- fix return value (move 'err = -EINVAL' in raw_sendmsg())
- add CAN XL frame handling in can_rcv()
- change comment for CAN_RAW_XL_[RT]X_DYN definition (allow -> enable)
V5: Remove CAN_RAW_XL_[RT]X_DYN definition again
https://lore.kernel.org/all/
20220719112748.3281-1-socketcan@hartkopp.net
- CAN_RAW_XL_[RT]X_DYN (truncated data) feature is now enabled by default
- use CANXL_MIN_DLEN instead of '1' in canxl_frame definition
- add missing 'err = -EINVAL' initialization in raw_sendmsg())
V6: https://lore.kernel.org/all/
20220724074402.117394-1-socketcan@hartkopp.net
- rework an separate skb identification and length helpers
- add CANFD_FDF flag in all CAN FD frame structures
- simplify patches for infrastructure and raw sockets
- add vxcan support in virtual CAN interface patch
V7: https://lore.kernel.org/all/
20220729154107.1875-1-socketcan@hartkopp.net
- fixed indention as remarked by Marc
- set CANFD_FDF flag when detecting CAN FD frames generated by PF_PACKET
- Allow to use variable CAN XL MTU sizes to enforce real time requirements
on CAN XL segments (e.g. to support of CAN CiA segmentation concept)
V8: https://lore.kernel.org/all/
20220801190010.3344-1-socketcan@hartkopp.net
- fixed typo as remarked by Vincent
- rebased to latest can-next/net-next tree
V9: https://lore.kernel.org/all/
20220912170725.120748-1-socketcan@hartkopp.net
- rebased to latest can-next/net-next tree
- updated and extended public available CAN XL documenatation in cover letter
- renamed struct canxl_frame variable cfx to cxl as suggested by Vincent
- Added Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> tag
Link: https://lore.kernel.org/all/20220912170725.120748-1-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Oliver Hartkopp [Mon, 12 Sep 2022 17:07:25 +0000 (19:07 +0200)]
can: raw: add CAN XL support
Enable CAN_RAW sockets to read and write CAN XL frames analogue to the
CAN FD extension (new CAN_RAW_XL_FRAMES sockopt).
A CAN XL network interface is capable to handle Classical CAN, CAN FD and
CAN XL frames. When CAN_RAW_XL_FRAMES is enabled, the CAN_RAW socket checks
whether the addressed CAN network interface is capable to handle the
provided CAN frame.
In opposite to the fixed number of bytes for
- CAN frames (CAN_MTU = sizeof(struct can_frame))
- CAN FD frames (CANFD_MTU = sizeof(struct can_frame))
the number of bytes when reading/writing CAN XL frames depends on the
number of data bytes. For efficiency reasons the length of the struct
canxl_frame is truncated to the needed size for read/write operations.
This leads to a calculated size of CANXL_HDR_SIZE + canxl_frame::len which
is enforced on write() operations and guaranteed on read() operations.
NB: Valid length values are 1 .. 2048 (CANXL_MIN_DLEN .. CANXL_MAX_DLEN).
Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20220912170725.120748-8-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Oliver Hartkopp [Mon, 12 Sep 2022 17:07:24 +0000 (19:07 +0200)]
can: dev: add CAN XL support to virtual CAN
Make use of new can_skb_get_data_len() helper.
Add support for variable CANXL MTU using the new can_is_canxl_dev_mtu().
Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20220912170725.120748-7-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Oliver Hartkopp [Mon, 12 Sep 2022 17:07:23 +0000 (19:07 +0200)]
can: canxl: update CAN infrastructure for CAN XL frames
- add new ETH_P_CANXL ethernet protocol type
- update skb checks for CAN XL
- add alloc_canxl_skb() which now needs a data length parameter
- introduce init_can_skb_reserve() to reduce code duplication
Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20220912170725.120748-6-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Oliver Hartkopp [Mon, 12 Sep 2022 17:07:22 +0000 (19:07 +0200)]
can: canxl: introduce CAN XL data structure
This patch adds defines for data structures and length information for
CAN XL (CAN with eXtended data Length) which can transfer up to 2048
byte inside a single frame.
Notable changes from CAN FD:
- the 11 bit arbitration field is now named 'priority' instead of 'can_id'
(there are no 29 bit identifiers nor RTR frames anymore)
- the data length needs a uint16 value to cover up to 2048 byte
(the length element position is different to struct can[fd]_frame)
- new fields (SDT, AF) and a SEC bit have been introduced
- the virtual CAN interface identifier is not part if the CAN XL frame
struct as this VCID value is stored in struct skbuff (analog to vlan id)
Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20220912170725.120748-5-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Oliver Hartkopp [Mon, 12 Sep 2022 17:07:21 +0000 (19:07 +0200)]
can: set CANFD_FDF flag in all CAN FD frame structures
To simplify the testing in user space all struct canfd_frame's provided by
the CAN subsystem of the Linux kernel now have the CANFD_FDF flag set in
canfd_frame::flags.
NB: Handcrafted ETH_P_CANFD frames introduced via PF_PACKET socket might
not set this bit correctly. During the check for sufficient headroom in
PF_PACKET sk_buffs the uninitialized CAN sk_buff data structures are filled.
In the case of a CAN FD frame the CANFD_FDF flag is set accordingly.
As the CAN frame content is already zero initialized in alloc_canfd_skb()
the obsolete initialization of cf->flags in the CTU CAN FD driver has been
removed as it would overwrite the already set CANFD_FDF flag.
Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20220912170725.120748-4-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Oliver Hartkopp [Mon, 12 Sep 2022 17:07:20 +0000 (19:07 +0200)]
can: skb: add skb CAN frame data length helpers
Add two helpers to retrieve the data length from CAN sk_buffs and prepare
the length information to be a uint16 value for the CAN XL support.
Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20220912170725.120748-3-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Oliver Hartkopp [Mon, 12 Sep 2022 17:07:19 +0000 (19:07 +0200)]
can: skb: unify skb CAN frame identification helpers
Replace open coded checks for sk_buffs containing Classical CAN and
CAN FD frame structures as a preparation for CAN XL support.
With the added length check the unintended processing of CAN XL frames
having the CANXL_XLF bit set can be suppressed even when the skb->len
fits to non CAN XL frames.
The CAN_RAW socket needs a rework to use these helpers. Therefore the
use of these helpers is postponed to the CAN_RAW CAN XL integration.
The J1939 protocol gets a check for Classical CAN frames too.
Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20220912170725.120748-2-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Yang Yingliang [Wed, 14 Sep 2022 13:40:30 +0000 (21:40 +0800)]
can: flexcan: Switch to use dev_err_probe() helper
dev_err() can be replace with dev_err_probe() which will check if error
code is -EPROBE_DEFER.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/all/20220914134030.3782754-1-yangyingliang@huawei.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Heiner Kallweit [Tue, 6 Sep 2022 18:24:57 +0000 (20:24 +0200)]
r8169: remove rtl_wol_shutdown_quirk()
Since
f658b90977d2 ("r8169: fix DMA being used after buffer free if WoL is
enabled") it has been redundant to disable PCI bus mastering in
rtl_wol_shutdown_quirk(). And since
120068481405 ("r8169: fix failing WoL")
CmdRxEnb is still enabled when we get here. So we can remove the function.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/2391ada0-eac5-ac43-f061-a7a44b0e7f33@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Pieter Jansen van Vuuren [Tue, 6 Sep 2022 10:56:20 +0000 (11:56 +0100)]
sfc: introduce shutdown entry point in efx pci driver
Make the device inactive when the system shutdown callback has been
invoked. This is achieved by freezing the driver and disabling the
PCI bus mastering.
Co-developed-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: Pieter Jansen van Vuuren <pieter.jansen-van-vuuren@amd.com>
Acked-by: Edward Cree <ecree.xilinx@gmail.com>
Link: https://lore.kernel.org/r/20220906105620.26179-1-pieter.jansen-van-vuuren@amd.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Jilin Yuan [Wed, 7 Sep 2022 04:03:46 +0000 (12:03 +0800)]
net: openvswitch: fix repeated words in comments
Delete the redundant word 'is'.
Signed-off-by: Jilin Yuan <yuanjilin@cdjrlc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 9 Sep 2022 10:45:25 +0000 (11:45 +0100)]
Merge branch 'net-ipa-next'
Alex Elder says:
====================
net: ipa: don't use lists for transaction state
This is the last series of patches to convert the IPA code so
integer IDs are used rather than lists to track the state of
transactions.
A first series of patches added ID fields to track the state of
transactions:
https://lore.kernel.org/netdev/
20220831224017.377745-1-elder@linaro.org
The second series started transitioning code to use these IDs rather
than lists to manage state:
https://lore.kernel.org/netdev/
20220902210218.745873-1-elder@linaro.org
This final series finishes the transition, to always use IDs instead
of the lists to manage transaction state. As a result, the list
fields, links, and a spinlock to protect updates are no longer
needed, so they are removed. This permits a few other improvements
to be implemented.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Alex Elder [Tue, 6 Sep 2022 17:19:42 +0000 (12:19 -0500)]
net: ipa: don't have gsi_channel_update() return a value
If it finds no completed transactions, gsi_channel_trans_complete()
calls gsi_channel_update() to check hardware. If new transactions
have completed, gsi_channel_update() records that, then calls
gsi_channel_trans_complete() to return the first of those found.
This recursion won't go any further, but can be avoided if we
have gsi_channel_update() only be responsible for updating state
after accessing hardware.
Change gsi_channel_update() so it simply checks for and handles
new completions, without returning a value. If it needs to call
that function, have gsi_channel_trans_complete() determine whether
there are new transactions available after the update.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alex Elder [Tue, 6 Sep 2022 17:19:41 +0000 (12:19 -0500)]
net: ipa: update channel in gsi_channel_trans_complete()
Have gsi_channel_trans_complete() update the known state from
hardware rather than doing so in gsi_channel_poll_one().
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alex Elder [Tue, 6 Sep 2022 17:19:40 +0000 (12:19 -0500)]
net: ipa: kill all other transaction lists
None of the transaction lists are actually needed any more, because
transaction IDs (which have been shown to be equivalent) are used
instead. So we can remove all of them, as well as the spinlock
that protects updates to them.
Not requiring a lock simplifies gsi_trans_free() as well; we only
need to check the reference count once to decide whether we've hit
the last reference.
This makes the links field in the gsi_trans structure unused, so get
rid of that as well.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alex Elder [Tue, 6 Sep 2022 17:19:39 +0000 (12:19 -0500)]
net: ipa: kill the allocated transaction list
The only place the trans_info->alloc list is used is when
initializing it, when adding a transaction to it when allocation
finishes, and when moving a transaction from that list to the
committed list.
We can just skip putting a transaction on the allocated list, and
add it (rather than move it) to the committed list when it is
committed.
On additional caveat is that an allocated transaction that's
committed without any TREs added will be immediately freed. Because
we aren't adding allocated transactions to a list any more, the
list links need to be initialized to ensure they're valid at the
time list_del() is called for the transaction.
Then we can safely eliminate the allocated transaction list.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alex Elder [Tue, 6 Sep 2022 17:19:38 +0000 (12:19 -0500)]
net: ipa: always use transaction IDs instead of lists
In gsi_channel_trans_complete(), use the completed and pending IDs
to determine whether there are any transactions in completed state.
Similarly, in gsi_channel_trans_cancel_pending(), use the pending
and committed IDs to mark pending transactions cancelled. Rearrange
the logic a bit there for a simpler result.
This removes the only user of list_last_entry_or_null(), so get rid
of that macro.
Remove the temporary warnings added by the previous commit.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 9 Sep 2022 09:59:13 +0000 (10:59 +0100)]
Merge branch 'felix-dsa-ethtool-stats'
Vladimir Oltean says:
====================
Standardized ethtool counters for Felix DSA driver
The main purpose of this change set is to add reporting of structured
ethtool statistics counters to the felix DSA driver (see patch 11/14 for
details), as a prerequisite for extending these counters to the
eMAC/pMAC defined by the IEEE MAC Merge layer.
Along the way, the main purpose has diverged into multiple sub-purposes
which are also tackled:
- A bug fix patch submitted to "net" has made ocelot->stats_lock a spin
lock, which is not an issue currently (all Ocelot switches are MMIO),
but will be an issue for Colin Foster who is working on a SPI
controlled Ocelot switch. We restore the hardware access to port stats
to be sleepable.
- PSFP (tc-gate, tc-police) tc-flower stats on Felix use a non-converged
procedure to access the hardware counters, although the interface is
very similar to what is used for the port counters. Benefit from the
logic used for the port counters, which gains us 64-bit tc-flower
stats that are resistant to overflows.
- Also export the ndo_get_stats64 method used by the ocelot switchdev
driver to Felix, so that ifconfig sees something hardware-based as
well (but not 100% up to date).
- Create a new ocelot_stats.c file which groups everything stats-related
together. Along with this, also move some other topic-specific code,
like FDB and PTP, out of the main ocelot.c.
- Minimize the lines of code for the stats layout definitions. These
changes alone cause the patch set to have an overall reduction of
lines of code in the driver, even though we are adding new
functionality as well.
Tested the port counters with lockdep and friends, with some
garden-variety traffic (ping, iperf3) and the PSFP counters with
tools/testing/selftests/drivers/net/ocelot/psfp.sh.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Vladimir Oltean [Thu, 8 Sep 2022 16:48:16 +0000 (19:48 +0300)]
net: mscc: ocelot: share the common stat definitions between all drivers
All switch families supported by the ocelot lib (ocelot, felix, seville)
export the same registers so far. But for example felix also has TSN
counters, while the others don't.
To reduce the bloat even further, create an OCELOT_COMMON_STATS() macro
which just lists all stats that are common between switches. The array
elements are still replicated among all of vsc9959_stats_layout,
vsc9953_stats_layout and ocelot_stats_layout.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vladimir Oltean [Thu, 8 Sep 2022 16:48:15 +0000 (19:48 +0300)]
net: mscc: ocelot: minimize definitions for stats
The current definition of struct ocelot_stat_layout is long-winded (4
lines per entry, and we have hundreds of entries), so we could make an
effort to use the C preprocessor and reduce the line count.
Create an implicit correspondence between enum ocelot_reg, which tells
us the register address (SYS_COUNT_RX_OCTETS etc) and enum ocelot_stat
which allows us to index the ocelot->stats array (OCELOT_STAT_RX_OCTETS
etc), and don't require us to specify both when we define what stats
each switch family has.
Create an OCELOT_STAT() macro that pairs only an enum ocelot_stat to an
enum ocelot_reg, and an OCELOT_STAT_ETHTOOL() macro which also contains
a name exported to the unstructured ethtool -S stringset API. For now,
we define all counters as having the OCELOT_STAT_ETHTOOL() kind, but we
will add more counters in the future which are not exported to the
unstructured ethtool -S.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vladimir Oltean [Thu, 8 Sep 2022 16:48:14 +0000 (19:48 +0300)]
net: mscc: ocelot: harmonize names of SYS_COUNT_TX_AGING and OCELOT_STAT_TX_AGED
The hardware counter is called C_TX_AGED, so rename SYS_COUNT_TX_AGING
to SYS_COUNT_TX_AGED. This will become important since we want to
minimize the way in which we declare struct ocelot_stat_layout elements,
using the C preprocessor.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vladimir Oltean [Thu, 8 Sep 2022 16:48:13 +0000 (19:48 +0300)]
net: mscc: ocelot: add support for all sorts of standardized counters present in DSA
DSA is integrated with the new standardized ethtool -S --groups option,
but the felix driver only exports unstructured statistics.
Reuse the array of 64-bit statistics collected by ocelot_check_stats_work(),
but just export select values from it.
Since ocelot_check_stats_work() runs periodically to avoid 32-bit
overflow, and the ethtool calling context is sleepable, we update the
64-bit stats one more time, to provide up-to-date values. The locking
scheme with a mutex followed by a spinlock is a bit hard to digest, so
we create and use a ocelot_port_stats_run() helper with a callback that
populates the ethool stats group the caller is interested in.
The exported stats are:
ethtool -S swp0 --groups eth-phy
ethtool -S swp0 --groups eth-mac
ethtool -S swp0 --groups eth-ctrl
ethtool -S swp0 --groups rmon
ethtool --include-statistics --show-pause swp0
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vladimir Oltean [Thu, 8 Sep 2022 16:48:12 +0000 (19:48 +0300)]
net: mscc: ocelot: exclude stats from bulk regions based on reg, not name
We want to introduce elements kept in ocelot->stats that aren't exposed
to the unstructured ethtool -S (so they won't have their name populated),
but are otherwise checked for 32-bit wraparounds by
ocelot_port_update_stats().
This isn't possible today because ocelot_prepare_stats_regions() skips
over ocelot_stat_layout elements with no name. Now that we've changed
struct ocelot_stat_layout to keep the absolute register address rather
than the offset relative to SYS_CNT, we can make use of the unpopulated
"reg" value of 0 to mean that the counter isn't present on the current
switch revision, and skip it from the preparation of bulk regions.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vladimir Oltean [Thu, 8 Sep 2022 16:48:11 +0000 (19:48 +0300)]
net: dsa: felix: use ocelot's ndo_get_stats64 method
Move the logic from the ocelot switchdev driver's ocelot_get_stats64()
method to the common switch lib and reuse it for the DSA driver.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vladimir Oltean [Thu, 8 Sep 2022 16:48:10 +0000 (19:48 +0300)]
net: mscc: ocelot: move more PTP code from the lib to ocelot_ptp.c
Decongest ocelot.c a bit more by moving all PTP related logic (including
timestamp processing and PTP packet traps) to ocelot_ptp.c.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vladimir Oltean [Thu, 8 Sep 2022 16:48:09 +0000 (19:48 +0300)]
net: mscc: ocelot: unexport ocelot_port_fdb_do_dump from the common lib
ocelot_port_fdb_do_dump() is only used by ocelot_net.c, so move it
there.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vladimir Oltean [Thu, 8 Sep 2022 16:48:08 +0000 (19:48 +0300)]
net: mscc: ocelot: move stats code to ocelot_stats.c
The main C file of the ocelot switch lib, ocelot.c, is getting larger
and larger, and there are plans to add more logic related to stats.
So it seems like an appropriate moment to split the statistics code to a
new file.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vladimir Oltean [Thu, 8 Sep 2022 16:48:07 +0000 (19:48 +0300)]
net: mscc: ocelot: sort Makefile files alphabetically
Create a clear ordering of the files used to compile the switch lib and
the switchdev driver.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vladimir Oltean [Thu, 8 Sep 2022 16:48:06 +0000 (19:48 +0300)]
net: mscc: ocelot: report FIFO drop counters through stats->rx_dropped
if_link.h says:
* @rx_dropped: Number of packets received but not processed,
* e.g. due to lack of resources or unsupported protocol.
* For hardware interfaces this counter may include packets discarded
* due to L2 address filtering but should not include packets dropped
* by the device due to buffer exhaustion which are counted separately in
* @rx_missed_errors (since procfs folds those two counters together).
Currently we report "stats->rx_dropped = dev->stats.rx_dropped", the
latter being incremented by various entities in the stack. This is not
wrong, but we'd like to move ocelot_get_stats64() in the common ocelot
switch lib which is independent of struct net_device.
To do that, report the hardware RX drop counters instead. These drops
are due to policer action, or due to no destinations. When we have no
memory in the queue system, report this through rx_missed_errors, as
instructed.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vladimir Oltean [Thu, 8 Sep 2022 16:48:05 +0000 (19:48 +0300)]
net: dsa: felix: check the 32-bit PSFP stats against overflow
The Felix PSFP counters suffer from the same problem as the ocelot
ndo_get_stats64 ones - they are 32-bit, so they can easily overflow and
this can easily go undetected.
Add a custom hook in ocelot_check_stats_work() through which driver
specific actions can be taken, and update the stats for the existing
PSFP filters from that hook.
Previously, vsc9959_psfp_filter_add() and vsc9959_psfp_filter_del() were
serialized with respect to each other via rtnl_lock(). However, with the
new entry point into &psfp->sfi_list coming from the periodic worker, we
now need an explicit mutex to serialize access to these lists.
We used to keep a struct felix_stream_filter_counters on stack, through
which vsc9959_psfp_stats_get() - a FLOW_CLS_STATS callback - would
retrieve data from vsc9959_psfp_counters_get(). We need to become
smarter about that in 3 ways:
- we need to keep a persistent set of counters for each stream instead
of keeping them on stack
- we need to promote those counters from u32 to u64, and create a
procedure that properly keeps 64-bit counters. Since we clear the
hardware counters anyway, and we poll every 2 seconds, a simple
increment of a u64 counter with a u32 value will perfectly do the job.
- FLOW_CLS_STATS also expect incremental counters, so we also need to
zeroize our u64 counters every time sch_flower calls us
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vladimir Oltean [Thu, 8 Sep 2022 16:48:04 +0000 (19:48 +0300)]
net: mscc: ocelot: make access to STAT_VIEW sleepable again
To support SPI-controlled switches in the future, access to
SYS_STAT_CFG_STAT_VIEW needs to be done outside of any spinlock
protected region, but it still needs to be serialized (by a mutex).
Split the ocelot->stats_lock spinlock into a mutex that serializes
indirect access to hardware registers (ocelot->stat_view_lock) and a
spinlock that serializes access to the u64 ocelot->stats array.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vladimir Oltean [Thu, 8 Sep 2022 16:48:03 +0000 (19:48 +0300)]
net: dsa: felix: add definitions for the stream filter counters
TSN stream (802.1Qci, 802.1CB) filters are also accessed through
STAT_VIEW, just like the port registers, but these counters are per
stream, rather than per port. So we don't keep them in
ocelot_port_update_stats().
What we can do, however, is we can create register definitions for them
just like we have for the port counters, and delete the last remaining
user of the SYS_CNT register + a group index (read_gix).
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 9 Sep 2022 07:24:43 +0000 (08:24 +0100)]
Merge branch 'tc_action_ops-refactor'
Zhengchao Shao says:
====================
net: refactor the walk and lookup hook functions in tc_action_ops
The implementation logic of the walk/lookup hook function in each action
module is the same. Therefore, the two functions can be reconstructed.
When registering tc_action_ops of each action module, the corresponding
net_id is saved to tc_action_ops. In this way, the net_id of the
corresponding module can be directly obtained in act_api without executing
the specific walk and lookup hook functions. Then, generic functions can
be added to replace the walk and lookup hook functions of each action
module. Last, modify each action module in alphabetical order.
Reserve the walk and lookup interfaces and delete them when they are no
longer used.
This patchset has been tested by using TDC, and I will add selftest in
other patchset.
Last, thanks to Jamal Hadi Salim and Cong Wang for their advice.
---
v3: remove hole from the structure tc_action_ops
v2: save the net_id of each TC action module to the tc_action_ops structure
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:54 +0000 (12:14 +0800)]
net: sched: act_vlan: get rid of tcf_vlan_walker and tcf_vlan_search
tcf_vlan_walker() and tcf_vlan_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:53 +0000 (12:14 +0800)]
net: sched: act_tunnel_key: get rid of tunnel_key_walker and tunnel_key_search
tunnel_key_walker() and tunnel_key_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:52 +0000 (12:14 +0800)]
net: sched: act_skbmod: get rid of tcf_skbmod_walker and tcf_skbmod_search
tcf_skbmod_walker() and tcf_skbmod_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:51 +0000 (12:14 +0800)]
net: sched: act_skbedit: get rid of tcf_skbedit_walker and tcf_skbedit_search
tcf_skbedit_walker() and tcf_skbedit_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:50 +0000 (12:14 +0800)]
net: sched: act_simple: get rid of tcf_simp_walker and tcf_simp_search
tcf_simp_walker() and tcf_simp_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:49 +0000 (12:14 +0800)]
net: sched: act_sample: get rid of tcf_sample_walker and tcf_sample_search
tcf_sample_walker() and tcf_sample_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:48 +0000 (12:14 +0800)]
net: sched: act_police: get rid of tcf_police_walker and tcf_police_search
tcf_police_walker() and tcf_police_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:47 +0000 (12:14 +0800)]
net: sched: act_pedit: get rid of tcf_pedit_walker and tcf_pedit_search
tcf_pedit_walker() and tcf_pedit_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:46 +0000 (12:14 +0800)]
net: sched: act_nat: get rid of tcf_nat_walker and tcf_nat_search
tcf_nat_walker() and tcf_nat_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:45 +0000 (12:14 +0800)]
net: sched: act_mpls: get rid of tcf_mpls_walker and tcf_mpls_search
tcf_mpls_walker() and tcf_mpls_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:44 +0000 (12:14 +0800)]
net: sched: act_mirred: get rid of tcf_mirred_walker and tcf_mirred_search
tcf_mirred_walker() and tcf_mirred_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:43 +0000 (12:14 +0800)]
net: sched: act_ipt: get rid of tcf_ipt_walker/tcf_xt_walker and tcf_ipt_search/tcf_xt_search
tcf_ipt_walker()/tcf_xt_walker() and tcf_ipt_search()/tcf_xt_search() do
the same thing as generic walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:42 +0000 (12:14 +0800)]
net: sched: act_ife: get rid of tcf_ife_walker and tcf_ife_search
tcf_ife_walker() and tcf_ife_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:41 +0000 (12:14 +0800)]
net: sched: act_gate: get rid of tcf_gate_walker and tcf_gate_search
tcf_gate_walker() and tcf_gate_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:40 +0000 (12:14 +0800)]
net: sched: act_gact: get rid of tcf_gact_walker and tcf_gact_search
tcf_gact_walker() and tcf_gact_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:39 +0000 (12:14 +0800)]
net: sched: act_ctinfo: get rid of tcf_ctinfo_walker and tcf_ctinfo_search
tcf_ctinfo_walker() and tcf_ctinfo_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:38 +0000 (12:14 +0800)]
net: sched: act_ct: get rid of tcf_ct_walker and tcf_ct_search
tcf_ct_walker() and tcf_ct_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:37 +0000 (12:14 +0800)]
net: sched: act_csum: get rid of tcf_csum_walker and tcf_csum_search
tcf_csum_walker() and tcf_csum_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:36 +0000 (12:14 +0800)]
net: sched: act_connmark: get rid of tcf_connmark_walker and tcf_connmark_search
tcf_connmark_walker() and tcf_connmark_search() do the same thing as
generic walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:35 +0000 (12:14 +0800)]
net: sched: act_bpf: get rid of tcf_bpf_walker and tcf_bpf_search
tcf_bpf_walker() and tcf_bpf_search() do the same thing as generic
walk/search function, so remove them.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:34 +0000 (12:14 +0800)]
net: sched: act_api: implement generic walker and search for tc action
Being able to get tc_action_net by using net_id stored in tc_action_ops
and execute the generic walk/search function, add __tcf_generic_walker()
and __tcf_idr_search() helpers.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Zhengchao Shao [Thu, 8 Sep 2022 04:14:33 +0000 (12:14 +0800)]
net: sched: act: move global static variable net_id to tc_action_ops
Each tc action module has a corresponding net_id, so put net_id directly
into the structure tc_action_ops.
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 9 Sep 2022 07:20:58 +0000 (08:20 +0100)]
Merge branch 'lan743x-next'
Raju Lakkaraju says:
====================
net: lan743x: Fix to use multiqueue start/stop APIs
This patch series address the fix to use multiqueue start/stop APIs and Add Rx IP and TCP checksum offload
Changes:
========
V1 -> V2:
- Fix the sparse warnings
V0 -> V1:
- Remove chip SKU check conditionals
- Update the changes description
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Raju Lakkaraju [Thu, 8 Sep 2022 08:28:34 +0000 (13:58 +0530)]
net: lan743x: Add support for Rx IP & TCP checksum offload
Add Rx IP and TCP checksum offload
Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>