From c3ca04b091ca8092894c4ae339af43c13ce6f531 Mon Sep 17 00:00:00 2001 From: Ashish Trivedi Date: Fri, 7 Mar 2025 09:45:52 -0800 Subject: [PATCH 01/11] @FIR-595: Reducded the lower UDMA reserved area to only 256 MB --- arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi b/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi index a353beef6454..1ed17eee8fc9 100644 --- a/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi +++ b/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi @@ -28,7 +28,7 @@ service_reserved1: svcbuffer@1 { compatible = "shared-dma-pool"; reusable; - reg = <0x0 0x40000000 0x0 0x40000000>; + reg = <0x0 0x70000000 0x0 0x10000000>; alignment = <0x1000>; }; service_reserved2: svcbuffer@2 { @@ -41,7 +41,7 @@ udmabuf@0 { compatible = "ikwzm,u-dma-buf"; device-name = "udmabuf0"; - size = <0x40000000>; // 1GiB + size = <0x10000000>; // 1GiB memory-region = <&service_reserved1>; }; From 00867dd9fbad54b5c297f212547395c657a9dc9c Mon Sep 17 00:00:00 2001 From: Ashish Trivedi Date: Sun, 9 Mar 2025 12:12:04 -0700 Subject: [PATCH 02/11] @FIR-595: Enabled nttables and iptables --- arch/arm64/configs/defconfig | 58 ++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 419b207a2fa7..1a0bab913ec5 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -1606,3 +1606,61 @@ CONFIG_BLK_DEV_NVME=y #CONFIG_NVME_HWMON=y #CONFIG_NVME_FC=y CONFIG_DUMMY=m + +####################### +# For Flannel +####################### +CONFIG_NETFILTER_NETLINK=m +CONFIG_NETFILTER_XT_MATCH_OWNER=m +CONFIG_NET_UDP_TUNNEL=m +CONFIG_NF_DUP_NETDEV=m +CONFIG_NF_LOG_BRIDGE=m +CONFIG_NF_TABLES_ARP=y +CONFIG_NF_TABLES_BRIDGE=y +CONFIG_NF_TABLES_INET=y +CONFIG_NF_TABLES_IPV4=y +CONFIG_NF_TABLES_IPV6=y +CONFIG_NF_TABLES=m +CONFIG_NF_TABLES_NETDEV=y +CONFIG_NFT_BRIDGE_REJECT=m +CONFIG_NFT_CHAIN_NAT_IPV4=m +CONFIG_NFT_CHAIN_ROUTE_IPV4=m +CONFIG_NFT_CHAIN_ROUTE_IPV6=m +CONFIG_NFT_COMPAT=m +CONFIG_NFT_COUNTER=m +CONFIG_NFT_CT=m +CONFIG_NFT_DUP_IPV4=m +CONFIG_NFT_DUP_IPV6=m +CONFIG_NFT_DUP_NETDEV=m +CONFIG_NFT_FIB_INET=m +CONFIG_NFT_FIB_IPV4=m +CONFIG_NFT_FIB_IPV6=m +CONFIG_NFT_FIB_NETDEV=m +CONFIG_NFT_FWD_NETDEV=m +CONFIG_NFT_HASH=m +CONFIG_NFT_LIMIT=m +CONFIG_NFT_LOG=m +CONFIG_NFT_MASQ_IPV4=m +CONFIG_NFT_MASQ=m +CONFIG_NFT_NAT=m +CONFIG_NFT_NUMGEN=m +CONFIG_NFT_QUEUE=m +CONFIG_NFT_QUOTA=m +CONFIG_NFT_REDIR_IPV4=m +CONFIG_NFT_REDIR=m +CONFIG_NFT_REJECT=m +CONFIG_STP=m + + + +CONFIG_NF_TABLES_INET=y +CONFIG_NF_TABLES_IPV4=y +CONFIG_NF_TABLES_IPV6=y +CONFIG_NFT_REJECT_INET=m +CONFIG_NFT_REJECT_IPV4=m +CONFIG_NFT_REJECT_IPV6=m +CONFIG_NFT_CONNLIMIT=m +CONFIG_NFT_TUNNEL=m +CONFIG_NFT_OBJREF=m +CONFIG_NFT_QUEUE=m +CONFIG_NFT_QUOTA=m From 0f4fd3d2d164a662b07d5a97fa03b8182b252beb Mon Sep 17 00:00:00 2001 From: Ashish Trivedi Date: Sun, 9 Mar 2025 12:54:32 -0700 Subject: [PATCH 03/11] @FIR-592: Moved the 128 MB reserved area to 0x60000000 --- arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi b/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi index 1ed17eee8fc9..3ad0c5d3cd9c 100644 --- a/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi +++ b/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi @@ -28,7 +28,7 @@ service_reserved1: svcbuffer@1 { compatible = "shared-dma-pool"; reusable; - reg = <0x0 0x70000000 0x0 0x10000000>; + reg = <0x0 0x60000000 0x0 0x10000000>; alignment = <0x1000>; }; service_reserved2: svcbuffer@2 { From 1d16890c2b4a6e1110f580d58c5eb0a7693cdc06 Mon Sep 17 00:00:00 2001 From: Ashish Trivedi Date: Sun, 9 Mar 2025 20:55:25 -0700 Subject: [PATCH 04/11] @FIR-595: Enable VXLAN and Wireguard --- arch/arm64/configs/defconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 1a0bab913ec5..69a0977be5b8 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -1664,3 +1664,8 @@ CONFIG_NFT_TUNNEL=m CONFIG_NFT_OBJREF=m CONFIG_NFT_QUEUE=m CONFIG_NFT_QUOTA=m +CONFIG_CFS_BANDWIDTH=y +CONFIG_WIREGUARD=m +CONFIG_VXLAN=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_FQ_CODEL=m From 8ac6a7ab06aa9636f935cfac572c354cc14eea4a Mon Sep 17 00:00:00 2001 From: Ashish Trivedi Date: Mon, 10 Mar 2025 09:31:15 -0700 Subject: [PATCH 05/11] @FIR-595: Reverted the dtsi file --- arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi b/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi index 3ad0c5d3cd9c..a353beef6454 100644 --- a/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi +++ b/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dtsi @@ -28,7 +28,7 @@ service_reserved1: svcbuffer@1 { compatible = "shared-dma-pool"; reusable; - reg = <0x0 0x60000000 0x0 0x10000000>; + reg = <0x0 0x40000000 0x0 0x40000000>; alignment = <0x1000>; }; service_reserved2: svcbuffer@2 { @@ -41,7 +41,7 @@ udmabuf@0 { compatible = "ikwzm,u-dma-buf"; device-name = "udmabuf0"; - size = <0x10000000>; // 1GiB + size = <0x40000000>; // 1GiB memory-region = <&service_reserved1>; }; From 620b27a65ed1eeeff0ba655ad6561885f9ce8d06 Mon Sep 17 00:00:00 2001 From: Ashish Trivedi Date: Mon, 10 Mar 2025 09:45:09 -0700 Subject: [PATCH 06/11] @FIR-595: Removed duplicate configs --- arch/arm64/configs/defconfig | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 69a0977be5b8..84345c2f6286 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -1610,8 +1610,11 @@ CONFIG_DUMMY=m ####################### # For Flannel ####################### +CONFIG_CFS_BANDWIDTH=y CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_XT_MATCH_OWNER=m +CONFIG_NET_SCH_HFSC=m +CONFIG_NET_SCH_FQ_CODEL=m CONFIG_NET_UDP_TUNNEL=m CONFIG_NF_DUP_NETDEV=m CONFIG_NF_LOG_BRIDGE=m @@ -1649,13 +1652,6 @@ CONFIG_NFT_QUOTA=m CONFIG_NFT_REDIR_IPV4=m CONFIG_NFT_REDIR=m CONFIG_NFT_REJECT=m -CONFIG_STP=m - - - -CONFIG_NF_TABLES_INET=y -CONFIG_NF_TABLES_IPV4=y -CONFIG_NF_TABLES_IPV6=y CONFIG_NFT_REJECT_INET=m CONFIG_NFT_REJECT_IPV4=m CONFIG_NFT_REJECT_IPV6=m @@ -1663,9 +1659,6 @@ CONFIG_NFT_CONNLIMIT=m CONFIG_NFT_TUNNEL=m CONFIG_NFT_OBJREF=m CONFIG_NFT_QUEUE=m -CONFIG_NFT_QUOTA=m -CONFIG_CFS_BANDWIDTH=y -CONFIG_WIREGUARD=m +CONFIG_STP=m CONFIG_VXLAN=m -CONFIG_NET_SCH_HFSC=m -CONFIG_NET_SCH_FQ_CODEL=m +CONFIG_WIREGUARD=m From d78d82b94716a213749d809ba1e0747a74fbe156 Mon Sep 17 00:00:00 2001 From: Ashish Trivedi Date: Wed, 12 Mar 2025 08:11:31 -0700 Subject: [PATCH 07/11] @FIR-595: Added VXLAN and UDP Tunnel support to dumy interfaces --- drivers/net/dummy.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index 5560cf683eb7..fbd7c83fdfd0 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c @@ -40,10 +40,32 @@ #include #include #include +#include #define DRV_NAME "dummy" static int numdummies = 1; +static int dummy_vxlan_set_port(struct net_device *netdev, unsigned int table, + unsigned int entry, struct udp_tunnel_info *ti) +{ + return 0; +} + +static int dummy_vxlan_unset_port(struct net_device *netdev, unsigned int table, + unsigned int entry, struct udp_tunnel_info *ti) +{ + return 0; +} + +static const struct udp_tunnel_nic_info dummy_udp_tunnels = { + .set_port = dummy_vxlan_set_port, + .unset_port = dummy_vxlan_unset_port, + .flags = UDP_TUNNEL_NIC_INFO_MAY_SLEEP | + UDP_TUNNEL_NIC_INFO_OPEN_ONLY, + .tables = { + { .n_entries = 1, .tunnel_types = UDP_TUNNEL_TYPE_VXLAN, }, + }, +}; /* fake multicast ability */ static void set_multicast_list(struct net_device *dev) @@ -71,6 +93,8 @@ static int dummy_dev_init(struct net_device *dev) if (!dev->lstats) return -ENOMEM; + dev->udp_tunnel_nic_info = &dummy_udp_tunnels; + netdev_lockdep_set_classes(dev); return 0; } From 04453e9d1d9680c6b8f8fbc00428279821e9e829 Mon Sep 17 00:00:00 2001 From: Ashish Trivedi Date: Wed, 12 Mar 2025 11:12:47 -0700 Subject: [PATCH 08/11] @FIR-595: Added debug prints --- net/ipv4/udp_tunnel_nic.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/ipv4/udp_tunnel_nic.c b/net/ipv4/udp_tunnel_nic.c index 029219749785..681b5cd088b8 100644 --- a/net/ipv4/udp_tunnel_nic.c +++ b/net/ipv4/udp_tunnel_nic.c @@ -769,19 +769,22 @@ static int udp_tunnel_nic_register(struct net_device *dev) struct udp_tunnel_nic_shared_node *node = NULL; struct udp_tunnel_nic *utn; unsigned int n_tables, i; - + netdev_WARN(dev, "LINE: %d", __LINE__); BUILD_BUG_ON(sizeof(utn->missed) * BITS_PER_BYTE < UDP_TUNNEL_NIC_MAX_TABLES); /* Expect use count of at most 2 (IPv4, IPv6) per device */ BUILD_BUG_ON(UDP_TUNNEL_NIC_USE_CNT_MAX < UDP_TUNNEL_NIC_MAX_SHARING_DEVICES * 2); + netdev_WARN(dev, "LINE: %d", __LINE__); /* Check that the driver info is sane */ if (WARN_ON(!info->set_port != !info->unset_port) || WARN_ON(!info->set_port == !info->sync_table) || WARN_ON(!info->tables[0].n_entries)) + { + netdev_WARN(dev, "LINE: %d", __LINE__); return -EINVAL; - + } if (WARN_ON(info->shared && info->flags & UDP_TUNNEL_NIC_INFO_OPEN_ONLY)) return -EINVAL; From ebb42da999764c1c743e272d37070e72c1824250 Mon Sep 17 00:00:00 2001 From: Ashish Trivedi Date: Wed, 12 Mar 2025 14:46:33 -0700 Subject: [PATCH 09/11] @FIR-595: Adding change to bring up eth0 --- .../dts/intel/fm87_ftile_10g_2port_ptp.dtsi | 206 ++++++++++++++++++ .../dts/intel/socfpga_agilex_bittware.dts | 40 +++- 2 files changed, 242 insertions(+), 4 deletions(-) create mode 100644 arch/arm64/boot/dts/intel/fm87_ftile_10g_2port_ptp.dtsi diff --git a/arch/arm64/boot/dts/intel/fm87_ftile_10g_2port_ptp.dtsi b/arch/arm64/boot/dts/intel/fm87_ftile_10g_2port_ptp.dtsi new file mode 100644 index 000000000000..c835c331f07c --- /dev/null +++ b/arch/arm64/boot/dts/intel/fm87_ftile_10g_2port_ptp.dtsi @@ -0,0 +1,206 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright(C) 2022, Intel Corporation + */ + +/* Add this piece of dtsi fragment as #include "fm87_ftile_25g_ptp.dtsi" + * in the file socfpga_fm87_ftile_25g_ptp.dts. Compile it in the kernel along with + * socfpga_agilex.dtsi + */ + +/{ + soc { + agilex_hps_bridges: bus@88000000 { + compatible = "simple-bus"; + reg = <0x80000000 0x60000000>, + <0xf9000000 0x00100000>; + reg-names = "axi_h2f", "axi_h2f_lw"; + #address-cells = <2>; + #size-cells = <1>; + ranges = <0x00000000 0x00000000 0xf9000000 0x00001000>, + <0x00000001 0x00000000 0x80000000 0x00040000>, + <0x00000001 0x04040050 0x84040050 0x00000010>, + <0x00000001 0x04040040 0x84040040 0x00000010>; + + + qsfp_eth0: qsfp-eth0 { + compatible = "sff,qsfp"; + i2c-bus = <&i2c0>; + qsfpdd_initmode-gpio = <&qsfpdd_ctrl_pio 1 GPIO_ACTIVE_HIGH>; + qsfpdd_modseln-gpio = <&qsfpdd_ctrl_pio 2 GPIO_ACTIVE_LOW>; + qsfpdd_modprsn-gpio = <&qsfpdd_status_pio 0 GPIO_ACTIVE_LOW>; + qsfpdd_resetn-gpio = <&qsfpdd_ctrl_pio 0 GPIO_ACTIVE_HIGH>; + qsfpdd_intn-gpio = <&qsfpdd_status_pio 1 GPIO_ACTIVE_LOW>; + agilex_hps_spim = <&qsfpdd_ctrl_pio 3 GPIO_ACTIVE_HIGH>; + maximum-power-milliwatt = <1000>; + status = "disable"; +/* status = "okay"; */ + }; + + qsfpdd_status_pio: gpio@4040050 { + compatible = "altr,pio-1.0"; + reg = <0x00000001 0x04040050 0x10>; + interrupt-parent = <&intc>; + interrupts = <0 22 4>; + altr,gpio-bank-width = <4>; + altr,interrupt-type = <2>; + + altr,interrupt_type = <2>; + #gpio-cells = <2>; + gpio-controller; + status = "okay"; + /*status = "disable";*/ + }; + + qsfpdd_ctrl_pio: gpio@4040040 { + compatible = "altr,pio-1.0"; + reg = <0x00000001 0x04040040 0x10>; + interrupt-parent = <&intc>; + interrupts = <0 23 4>; + altr,gpio-bank-width = <4>; + altr,interrupt-type = <2>; + altr,interrupt_type = <2>; + #gpio-cells = <2>; + gpio-controller; + status = "okay"; + /*status = "disable"; */ + }; + + }; + clocks { + tod_in_clock: tod_in_clock { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <156250000>; + clock-output-names = "tod_in_clock"; + }; + }; + + ptp_clockcleaner: ptp_clockcleaner { + compatible = "intel, freq-steering-zl-i2c"; + dpll-name = "zl30733"; + interface = "i2c"; + bus-num = <1>; + bus-address = <0x70>; + }; + + tod_0_clk: tod_0_clk { + compatible = "intel, tod"; + reg-names = "tod_ctrl", + "pps_ctrl"; + reg = <0x84040000 0x00000040>, + <0x84040100 0x00000040>; + interrupt-parent = <&intc>; + interrupt-names = "pps_irq"; + interrupts = <0 19 4>; + clocks = <&tod_in_clock>; + clock-names = "tod_clock"; + status = "okay"; + altr,has-ptp-clockcleaner; + clock-cleaner = <&ptp_clockcleaner>; + }; + + hssiss_0_hssiss: hssiss_0_hssiss { + compatible = "intel, hssiss-1.0"; + reg-names = "sscsr"; + reg = <0x88000000 0x04000000>; + reset-mode ="reg"; + }; + hssi_0_eth: hssi_0_eth@88000000 { + reg-names = "tx_pref" , + "tx_csr" , + "tx_fifo" , + "rx_pref" , + "rx_csr" , + "rx_fifo" ; + + reg = <0x8c480000 0x00000020>, + <0x8c480020 0x00000020>, + <0x8c480040 0x00000020>, + <0x8c480080 0x00000020>, + <0x8c4800A0 0x00000020>, + <0x8c4800C0 0x00000010>; + + compatible = "altr,hssi-ftile-1.0"; + tile_chan = <0x8>; + hssi_port = <0x8>; + phy-mode = "10gbase-r"; + tod = <&tod_0_clk>; + hssiss = <&hssiss_0_hssiss>; + pma_type = <0x0>; // FGT - 0x00, FHT = 0x1000 + altr,tx-pma-delay-ns = <0xD>; + altr,rx-pma-delay-ns = <0x8>; + altr,tx-pma-delay-fns = <0x24D>; + altr,rx-pma-delay-fns = <0x3E97>; + altr,tx-external-phy-delay-ns = <0x0>; + altr,rx-external-phy-delay-ns = <0x0>; + fec-cw-pos-rx = <0x0>; + fec-type="no-fec"; + interrupt-parent = <&intc>; + interrupt-names = "tx_irq", "rx_irq"; + interrupts = <0 24 4>, <0 25 4>; + qsfp-lane = <0x0>; + rx-fifo-depth = <0x4000>; + tx-fifo-depth = <0x1000>; + rx-fifo-almost-full = <0x2000>; + rx-fifo-almost-empty = <0x1000>; + altr,has-ptp; + ptp_accu_mode = "Advanced"; + ptp_tx_routing_adj = <0xDE9F>; //56,991 + ptp_rx_routing_adj = <0xD625>; //54,821 + status = "okay"; + fixed-link { + speed =<10000>; + full-duplex; + }; + }; + hssi_1_eth: hssi_1_eth@88000000 { + reg-names = "tx_pref" , + "tx_csr" , + "tx_fifo" , + "rx_pref" , + "rx_csr" , + "rx_fifo" ; + + reg = <0x8c4C0000 0x00000020>, + <0x8c4C0020 0x00000020>, + <0x8c4C0040 0x00000020>, + <0x8c4C0080 0x00000020>, + <0x8c4C00A0 0x00000020>, + <0x8c4C00C0 0x00000010>; + + compatible = "altr,hssi-ftile-1.0"; + tile_chan = <0x9>; + hssi_port = <0x9>; + phy-mode = "10gbase-r"; + tod = <&tod_0_clk>; + hssiss = <&hssiss_0_hssiss>; + pma_type = <0x0>; // FGT - 0x00, FHT = 0x1000 + altr,tx-pma-delay-ns = <0xD>; + altr,rx-pma-delay-ns = <0x8>; + altr,tx-pma-delay-fns = <0x24D>; + altr,rx-pma-delay-fns = <0x3E97>; + altr,tx-external-phy-delay-ns = <0x0>; + altr,rx-external-phy-delay-ns = <0x0>; + fec-cw-pos-rx = <0x0>; + fec-type="no-fec"; + interrupt-parent = <&intc>; + interrupt-names = "tx_irq", "rx_irq"; + interrupts = <0 26 4>, <0 27 4>; + qsfp-lane = <0x0>; + rx-fifo-depth = <0x4000>; + tx-fifo-depth = <0x1000>; + rx-fifo-almost-full = <0x2000>; + rx-fifo-almost-empty = <0x1000>; + altr,has-ptp; + ptp_accu_mode = "Advanced"; + ptp_tx_routing_adj = <0xDE3C>; //56,892 + ptp_rx_routing_adj = <0xD73F>; //55,103 + status = "okay"; + fixed-link { + speed =<10000>; + full-duplex; + }; + }; + }; +}; diff --git a/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dts b/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dts index b68a0e04610b..152f680b7ee6 100644 --- a/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dts +++ b/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dts @@ -4,6 +4,8 @@ */ #include "socfpga_agilex_bittware.dtsi" #include "socfpga_agilex_pcie_root_port.dtsi" +#include "fm87_ftile_10g_2port_ptp.dtsi" + / { model = "SoCFPGA Agilex BittWare"; @@ -47,18 +49,48 @@ status = "okay"; }; -&gmac2 { +&gmac0 { + status = "okay"; + phy-mode = "rgmii"; + phy-handle = <&phy0>; + + max-frame-size = <9000>; + + mdio0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + phy0: ethernet-phy@0 { + reg = <4>; + + txd0-skew-ps = <0>; /* -420ps */ + txd1-skew-ps = <0>; /* -420ps */ + txd2-skew-ps = <0>; /* -420ps */ + txd3-skew-ps = <0>; /* -420ps */ + rxd0-skew-ps = <420>; /* 0ps */ + rxd1-skew-ps = <420>; /* 0ps */ + rxd2-skew-ps = <420>; /* 0ps */ + rxd3-skew-ps = <420>; /* 0ps */ + txen-skew-ps = <0>; /* -420ps */ + txc-skew-ps = <900>; /* 0ps */ + rxdv-skew-ps = <420>; /* 0ps */ + rxc-skew-ps = <1680>; /* 780ps */ + }; + }; +}; + +&gmac1 { status = "disabled"; phy-mode = "rgmii"; - phy-handle = <&phy0>; + phy-handle = <&phy1>; max-frame-size = <9000>; - mdio0 { + mdio1 { #address-cells = <1>; #size-cells = <0>; compatible = "snps,dwmac-mdio"; - phy0: ethernet-phy@0 { + phy1: ethernet-phy@1 { reg = <4>; txd0-skew-ps = <0>; /* -420ps */ From 2935110d49a2cbe95710c8dc2f64fc47d2889f1c Mon Sep 17 00:00:00 2001 From: Ashish Trivedi Date: Thu, 13 Mar 2025 14:07:03 -0700 Subject: [PATCH 10/11] @FIR-595: Reverted changes to udp_tunnel_nic.c and dummy.c --- drivers/net/dummy.c | 24 ------------------------ net/ipv4/udp_tunnel_nic.c | 7 ++----- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index fbd7c83fdfd0..5560cf683eb7 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c @@ -40,32 +40,10 @@ #include #include #include -#include #define DRV_NAME "dummy" static int numdummies = 1; -static int dummy_vxlan_set_port(struct net_device *netdev, unsigned int table, - unsigned int entry, struct udp_tunnel_info *ti) -{ - return 0; -} - -static int dummy_vxlan_unset_port(struct net_device *netdev, unsigned int table, - unsigned int entry, struct udp_tunnel_info *ti) -{ - return 0; -} - -static const struct udp_tunnel_nic_info dummy_udp_tunnels = { - .set_port = dummy_vxlan_set_port, - .unset_port = dummy_vxlan_unset_port, - .flags = UDP_TUNNEL_NIC_INFO_MAY_SLEEP | - UDP_TUNNEL_NIC_INFO_OPEN_ONLY, - .tables = { - { .n_entries = 1, .tunnel_types = UDP_TUNNEL_TYPE_VXLAN, }, - }, -}; /* fake multicast ability */ static void set_multicast_list(struct net_device *dev) @@ -93,8 +71,6 @@ static int dummy_dev_init(struct net_device *dev) if (!dev->lstats) return -ENOMEM; - dev->udp_tunnel_nic_info = &dummy_udp_tunnels; - netdev_lockdep_set_classes(dev); return 0; } diff --git a/net/ipv4/udp_tunnel_nic.c b/net/ipv4/udp_tunnel_nic.c index 681b5cd088b8..029219749785 100644 --- a/net/ipv4/udp_tunnel_nic.c +++ b/net/ipv4/udp_tunnel_nic.c @@ -769,22 +769,19 @@ static int udp_tunnel_nic_register(struct net_device *dev) struct udp_tunnel_nic_shared_node *node = NULL; struct udp_tunnel_nic *utn; unsigned int n_tables, i; - netdev_WARN(dev, "LINE: %d", __LINE__); + BUILD_BUG_ON(sizeof(utn->missed) * BITS_PER_BYTE < UDP_TUNNEL_NIC_MAX_TABLES); /* Expect use count of at most 2 (IPv4, IPv6) per device */ BUILD_BUG_ON(UDP_TUNNEL_NIC_USE_CNT_MAX < UDP_TUNNEL_NIC_MAX_SHARING_DEVICES * 2); - netdev_WARN(dev, "LINE: %d", __LINE__); /* Check that the driver info is sane */ if (WARN_ON(!info->set_port != !info->unset_port) || WARN_ON(!info->set_port == !info->sync_table) || WARN_ON(!info->tables[0].n_entries)) - { - netdev_WARN(dev, "LINE: %d", __LINE__); return -EINVAL; - } + if (WARN_ON(info->shared && info->flags & UDP_TUNNEL_NIC_INFO_OPEN_ONLY)) return -EINVAL; From 3bc834911d687bc76fc1a7e40c86e71df12ab1ba Mon Sep 17 00:00:00 2001 From: Ashish Trivedi Date: Thu, 13 Mar 2025 20:30:23 -0700 Subject: [PATCH 11/11] @FIR-595: Addressed review comments and minimized diffs for eth0 --- .../dts/intel/socfpga_agilex_bittware.dts | 40 +++---------------- arch/arm64/configs/defconfig | 7 ++-- 2 files changed, 9 insertions(+), 38 deletions(-) diff --git a/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dts b/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dts index 152f680b7ee6..cc386a22dfcf 100644 --- a/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dts +++ b/arch/arm64/boot/dts/intel/socfpga_agilex_bittware.dts @@ -49,48 +49,18 @@ status = "okay"; }; -&gmac0 { - status = "okay"; - phy-mode = "rgmii"; - phy-handle = <&phy0>; - - max-frame-size = <9000>; - - mdio0 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "snps,dwmac-mdio"; - phy0: ethernet-phy@0 { - reg = <4>; - - txd0-skew-ps = <0>; /* -420ps */ - txd1-skew-ps = <0>; /* -420ps */ - txd2-skew-ps = <0>; /* -420ps */ - txd3-skew-ps = <0>; /* -420ps */ - rxd0-skew-ps = <420>; /* 0ps */ - rxd1-skew-ps = <420>; /* 0ps */ - rxd2-skew-ps = <420>; /* 0ps */ - rxd3-skew-ps = <420>; /* 0ps */ - txen-skew-ps = <0>; /* -420ps */ - txc-skew-ps = <900>; /* 0ps */ - rxdv-skew-ps = <420>; /* 0ps */ - rxc-skew-ps = <1680>; /* 780ps */ - }; - }; -}; - -&gmac1 { - status = "disabled"; +&gmac2 { + status = "okay"; phy-mode = "rgmii"; - phy-handle = <&phy1>; + phy-handle = <&phy0>; max-frame-size = <9000>; - mdio1 { + mdio0 { #address-cells = <1>; #size-cells = <0>; compatible = "snps,dwmac-mdio"; - phy1: ethernet-phy@1 { + phy0: ethernet-phy@0 { reg = <4>; txd0-skew-ps = <0>; /* -420ps */ diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 84345c2f6286..3d50ad32bf1a 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -1607,9 +1607,10 @@ CONFIG_BLK_DEV_NVME=y #CONFIG_NVME_FC=y CONFIG_DUMMY=m -####################### -# For Flannel -####################### +########################################## +# For Flannel enable config flags +# For NFT tables, STP, VXLAN and Wireguard +######################################### CONFIG_CFS_BANDWIDTH=y CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_XT_MATCH_OWNER=m