Skip to content

Commit

Permalink
[bot] AutoMerging: merge all upstream's changes:
Browse files Browse the repository at this point in the history
* https://github.com/coolsnowwolf/lede:
  Apply BCM578xx sfp2.5g patch to test 5.15 kernel (coolsnowwolf#8615)
  n2n: remove unsupported -s param (coolsnowwolf#8644)
  x86: 5.15: refresh kernel patches
  linux-firmware: add new package r8152-firmware
  mbedtls: enable session tickets
  • Loading branch information
github-actions[bot] committed Jan 8, 2022
2 parents 29c2887 + 60e2759 commit 12aba4e
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 33 deletions.
15 changes: 14 additions & 1 deletion package/firmware/linux-firmware/realtek.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
Package/r8152-firmware = $(call Package/firmware-default,RealTek RTL8152 firmware)
define Package/r8152-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/rtl_nic
$(CP) \
$(PKG_BUILD_DIR)/rtl_nic/rtl8153* \
$(PKG_BUILD_DIR)/rtl_nic/rtl8156* \
$(1)/lib/firmware/rtl_nic
endef
$(eval $(call BuildPackage,r8152-firmware))

Package/r8169-firmware = $(call Package/firmware-default,RealTek RTL8169 firmware)
define Package/r8169-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/rtl_nic
$(CP) \
$(PKG_BUILD_DIR)/rtl_nic/* \
$(PKG_BUILD_DIR)/rtl_nic/rtl810* \
$(PKG_BUILD_DIR)/rtl_nic/rtl8125* \
$(PKG_BUILD_DIR)/rtl_nic/rtl8168* \
$(PKG_BUILD_DIR)/rtl_nic/rtl84* \
$(1)/lib/firmware/rtl_nic
endef
$(eval $(call BuildPackage,r8169-firmware))
Expand Down
1 change: 1 addition & 0 deletions package/kernel/linux/modules/usb.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,7 @@ $(eval $(call KernelPackage,usb-net-rtl8150))

define KernelPackage/usb-net-rtl8152
TITLE:=Kernel module for USB-to-Ethernet Realtek convertors
DEPENDS:=+r8152-firmware +kmod-crypto-sha256 +kmod-usb-net-cdc-ncm
KCONFIG:=CONFIG_USB_RTL8152
FILES:=$(LINUX_DIR)/drivers/$(USBNET_DIR)/r8152.ko
AUTOLOAD:=$(call AutoProbe,r8152)
Expand Down
8 changes: 4 additions & 4 deletions package/lean/n2n_v2/files/n2n_v2.init
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ start_instance() {
config_get community "$cfg" 'community'
config_get key "$cfg" 'key'
config_get_bool route "$cfg" 'route' '0'
address="$ipaddr"
address="$ipaddr/$prefix"
supernode_bak=""
[ "$second_supernode" -a "$second_port" ] && supernode_bak=" -l ${second_supernode}:${second_port}"
[ "$route" = "1" ] && args='-r'
[ "$mode" = 'dhcp' ] && address='0.0.0.0'
[ "-$mtu" != "-" ] && mtu="-M $mtu"
eval "$(ipcalc.sh "$ipaddr/$prefix")"
netmask="$NETMASK"
/usr/bin/edge -u 0 -g 0 -d $tunname -a ${mode}:${address} -s $netmask -c $community $([ -n "$key" ] && echo -k $key) -l ${supernode}:${port}$supernode_bak $args $mtu
# eval "$(ipcalc.sh "$ipaddr/$prefix")"
# netmask="$NETMASK"
/usr/bin/edge -u 0 -g 0 -d $tunname -a ${mode}:${address} -c $community $([ -n "$key" ] && echo -k $key) -l ${supernode}:${port}$supernode_bak $args $mtu
iptables -I FORWARD -i "$tunname" -j ACCEPT -m comment --comment 'n2n edge eth'
iptables -I FORWARD -o "$tunname" -j ACCEPT -m comment --comment 'n2n edge eth'
iptables -t nat -I POSTROUTING -o "$tunname" -j MASQUERADE -m comment --comment 'n2n edge net'
Expand Down
18 changes: 0 additions & 18 deletions package/libs/mbedtls/patches/200-config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,6 @@

/**
* \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
@@ -1690,7 +1690,7 @@
*
* Comment this macro to disable support for SSL session tickets
*/
-#define MBEDTLS_SSL_SESSION_TICKETS
+//#define MBEDTLS_SSL_SESSION_TICKETS

/**
* \def MBEDTLS_SSL_EXPORT_KEYS
@@ -1720,7 +1720,7 @@
*
* Comment this macro to disable support for truncated HMAC in SSL
Expand Down Expand Up @@ -216,15 +207,6 @@

/**
* \def MBEDTLS_RSA_C
@@ -2913,7 +2913,7 @@
*
* Requires: MBEDTLS_CIPHER_C
*/
-#define MBEDTLS_SSL_TICKET_C
+//#define MBEDTLS_SSL_TICKET_C

/**
* \def MBEDTLS_SSL_CLI_C
@@ -3013,7 +3013,7 @@
*
* This module provides run-time version information.
Expand Down
2 changes: 1 addition & 1 deletion target/linux/x86/patches-5.15/011-tune_lzma_options.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -370,7 +370,7 @@ quiet_cmd_bzip2 = BZIP2 $@
@@ -413,7 +413,7 @@ quiet_cmd_bzip2 = BZIP2 $@
# ---------------------------------------------------------------------------

quiet_cmd_lzma = LZMA $@
Expand Down
19 changes: 10 additions & 9 deletions target/linux/x86/patches-5.15/090-fix-hv.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
--- a/drivers/hv/Kconfig
+++ b/drivers/hv/Kconfig
@@ -19,6 +19,7 @@ config HYPERV_TIMER
config HYPERV_UTILS
tristate "Microsoft Hyper-V Utilities driver"
depends on HYPERV && CONNECTOR && NLS
+ depends on PTP_1588_CLOCK_OPTIONAL
help
Select this option to enable the Hyper-V Utilities.
--- a/drivers/hv/Kconfig
+++ b/drivers/hv/Kconfig
@@ -18,6 +18,7 @@ config HYPERV_TIMER
config HYPERV_UTILS
tristate "Microsoft Hyper-V Utilities driver"
depends on HYPERV && CONNECTOR && NLS
+ depends on PTP_1588_CLOCK_OPTIONAL
help
Select this option to enable the Hyper-V Utilities.

Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
diff -Naur a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h 2020-09-03 23:21:36.695693427 -0400
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h 2020-09-03 23:29:22.457340229 -0400
@@ -1592,6 +1592,7 @@
uint num_ethernet_queues;
uint num_cnic_queues;
int disable_tpa;
+ int mask_tx_fault;

u32 rx_mode;
#define BNX2X_RX_MODE_NONE 0
diff -Naur a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c 2020-09-03 23:21:36.699693373 -0400
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c 2020-09-03 23:29:22.457340229 -0400
@@ -151,6 +151,7 @@

#define SFP_EEPROM_CON_TYPE_ADDR 0x2
#define SFP_EEPROM_CON_TYPE_VAL_UNKNOWN 0x0
+ #define SFP_EEPROM_CON_TYPE_VAL_SC 0x1
#define SFP_EEPROM_CON_TYPE_VAL_LC 0x7
#define SFP_EEPROM_CON_TYPE_VAL_COPPER 0x21
#define SFP_EEPROM_CON_TYPE_VAL_RJ45 0x22
@@ -4206,6 +4207,16 @@
0x1000);
DP(NETIF_MSG_LINK, "set SGMII AUTONEG\n");
} else {
+ /* Note that 2.5G works only when used with 1G advertisment */
+ if (fiber_mode && (phy->req_line_speed == SPEED_2500) &&
+ (phy->speed_cap_mask &
+ (PORT_HW_CFG_SPEED_CAPABILITY_D0_1G |
+ PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G))) {
+ bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
+ MDIO_WC_REG_SERDESDIGITAL_MISC1,
+ 0x6010);
+ }
+
bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
MDIO_WC_REG_COMBO_IEEE0_MIICTRL, &val16);
val16 &= 0xcebf;
@@ -4216,6 +4227,7 @@
val16 |= 0x2000;
break;
case SPEED_1000:
+ case SPEED_2500:
val16 |= 0x0040;
break;
default:
@@ -8169,6 +8181,7 @@
break;
}
case SFP_EEPROM_CON_TYPE_VAL_UNKNOWN:
+ case SFP_EEPROM_CON_TYPE_VAL_SC:
case SFP_EEPROM_CON_TYPE_VAL_LC:
case SFP_EEPROM_CON_TYPE_VAL_RJ45:
check_limiting_mode = 1;
@@ -8179,7 +8192,8 @@
(val[SFP_EEPROM_1G_COMP_CODE_ADDR] != 0)) {
DP(NETIF_MSG_LINK, "1G SFP module detected\n");
phy->media_type = ETH_PHY_SFP_1G_FIBER;
- if (phy->req_line_speed != SPEED_1000) {
+ if ((phy->req_line_speed != SPEED_1000) &&
+ (phy->req_line_speed != SPEED_2500)) {
u8 gport = params->port;
phy->req_line_speed = SPEED_1000;
if (!CHIP_IS_E1x(bp)) {
@@ -8411,7 +8425,7 @@
* some phys type ( e.g. JDSU )
*/

- for (timeout = 0; timeout < 60; timeout++) {
+ for (timeout = 0; timeout < 1800; timeout++) {
if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT)
rc = bnx2x_warpcore_read_sfp_module_eeprom(
phy, params, I2C_DEV_ADDR_A0, 1, 1, &val,
@@ -9238,6 +9252,7 @@
u16 tmp1, val;
/* Set option 1G speed */
if ((phy->req_line_speed == SPEED_1000) ||
+ (phy->req_line_speed == SPEED_2500) ||
(phy->media_type == ETH_PHY_SFP_1G_FIBER)) {
DP(NETIF_MSG_LINK, "Setting 1G force\n");
bnx2x_cl45_write(bp, phy,
@@ -9247,6 +9262,22 @@
bnx2x_cl45_read(bp, phy,
MDIO_PMA_DEVAD, MDIO_PMA_REG_10G_CTRL2, &tmp1);
DP(NETIF_MSG_LINK, "1.7 = 0x%x\n", tmp1);
+ if ((phy->req_line_speed == SPEED_2500) &&
+ (phy->speed_cap_mask &
+ (PORT_HW_CFG_SPEED_CAPABILITY_D0_1G |
+ PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G))) {
+ bnx2x_cl45_read_and_write(bp, phy,
+ MDIO_AN_DEVAD,
+ MDIO_AN_REG_8727_MISC_CTRL2,
+ ~(1<<5));
+ bnx2x_cl45_write(bp, phy,
+ MDIO_AN_DEVAD,
+ MDIO_AN_REG_8727_MISC_CTRL1, 0x0010);
+ } else {
+ bnx2x_cl45_write(bp, phy,
+ MDIO_AN_DEVAD,
+ MDIO_AN_REG_8727_MISC_CTRL1, 0x001C);
+ }
/* Power down the XAUI until link is up in case of dual-media
* and 1G
*/
@@ -9268,7 +9299,7 @@

DP(NETIF_MSG_LINK, "Setting 1G clause37\n");
bnx2x_cl45_write(bp, phy,
- MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL, 0);
+ MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL2, 0);
bnx2x_cl45_write(bp, phy,
MDIO_AN_DEVAD, MDIO_AN_REG_CL37_AN, 0x1300);
} else {
@@ -9276,9 +9307,12 @@
* registers although it is default
*/
bnx2x_cl45_write(bp, phy,
- MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL,
+ MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL2,
0x0020);
bnx2x_cl45_write(bp, phy,
+ MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL1,
+ 0x001C);
+ bnx2x_cl45_write(bp, phy,
MDIO_AN_DEVAD, MDIO_AN_REG_CL37_AN, 0x0100);
bnx2x_cl45_write(bp, phy,
MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 0x2040);
@@ -9569,6 +9603,11 @@
vars->line_speed = SPEED_10000;
DP(NETIF_MSG_LINK, "port %x: External link up in 10G\n",
params->port);
+ } else if ((link_status & (1<<1)) && (!(link_status & (1<<14)))) {
+ link_up = 1;
+ vars->line_speed = SPEED_2500;
+ DP(NETIF_MSG_LINK, "port %x: External link up in 2.5G\n",
+ params->port);
} else if ((link_status & (1<<0)) && (!(link_status & (1<<13)))) {
link_up = 1;
vars->line_speed = SPEED_1000;
@@ -9600,7 +9639,8 @@
}

if ((DUAL_MEDIA(params)) &&
- (phy->req_line_speed == SPEED_1000)) {
+ ((phy->req_line_speed == SPEED_1000) ||
+ (phy->req_line_speed == SPEED_2500))) {
bnx2x_cl45_read(bp, phy,
MDIO_PMA_DEVAD,
MDIO_PMA_REG_8727_PCS_GP, &val1);
@@ -11730,6 +11770,7 @@
SUPPORTED_100baseT_Full |
SUPPORTED_1000baseT_Full |
SUPPORTED_1000baseKX_Full |
+ SUPPORTED_2500baseX_Full |
SUPPORTED_10000baseT_Full |
SUPPORTED_10000baseKR_Full |
SUPPORTED_20000baseKR2_Full |
@@ -11916,6 +11957,7 @@
.tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
.mdio_ctrl = 0,
.supported = (SUPPORTED_10000baseT_Full |
+ SUPPORTED_2500baseX_Full |
SUPPORTED_1000baseT_Full |
SUPPORTED_FIBRE |
SUPPORTED_Pause |
@@ -12263,6 +12305,7 @@
break;
case PORT_HW_CFG_NET_SERDES_IF_SFI:
phy->supported &= (SUPPORTED_1000baseT_Full |
+ SUPPORTED_2500baseX_Full |
SUPPORTED_10000baseT_Full |
SUPPORTED_FIBRE |
SUPPORTED_Pause |
@@ -13947,7 +13990,8 @@
& PORT_HW_CFG_NET_SERDES_IF_MASK) ==
PORT_HW_CFG_NET_SERDES_IF_SFI) {
if (bnx2x_is_sfp_module_plugged(phy, params)) {
- bnx2x_sfp_tx_fault_detection(phy, params, vars);
+ if(!((params->port + 1) & bp->mask_tx_fault))
+ bnx2x_sfp_tx_fault_detection(phy, params, vars);
} else if (vars->link_status &
LINK_STATUS_SFP_TX_FAULT) {
/* Clean trail, interrupt corrects the leds */
diff -Naur a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c 2020-09-03 23:21:36.699693373 -0400
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c 2020-09-03 23:29:22.461340175 -0400
@@ -105,6 +105,10 @@
module_param(disable_tpa, int, 0444);
MODULE_PARM_DESC(disable_tpa, " Disable the TPA (LRO) feature");

+static int mask_tx_fault;
+module_param(mask_tx_fault, int, 0444);
+MODULE_PARM_DESC(mask_tx_fault, " Mask SFP TX fault detection");
+
static int int_mode;
module_param(int_mode, int, 0444);
MODULE_PARM_DESC(int_mode, " Force interrupt mode other than MSI-X "
@@ -12455,6 +12459,8 @@
if (BP_NOMCP(bp) && (func == 0))
dev_err(&bp->pdev->dev, "MCP disabled, must load devices in order!\n");

+ bp->mask_tx_fault = mask_tx_fault;
+
bp->disable_tpa = disable_tpa;
bp->disable_tpa |= !!IS_MF_STORAGE_ONLY(bp);
/* Reduce memory usage in kdump environment by disabling TPA */
diff -Naur a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h 2020-09-03 23:21:36.699693373 -0400
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h 2020-09-03 23:22:22.975062197 -0400
@@ -7169,7 +7169,8 @@
#define MDIO_PMA_REG_8727_PCS_GP 0xc842
#define MDIO_PMA_REG_8727_OPT_CFG_REG 0xc8e4

-#define MDIO_AN_REG_8727_MISC_CTRL 0x8309
+#define MDIO_AN_REG_8727_MISC_CTRL1 0x8308
+#define MDIO_AN_REG_8727_MISC_CTRL2 0x8309

#define MDIO_PMA_REG_8073_CHIP_REV 0xc801
#define MDIO_PMA_REG_8073_SPEED_LINK_STATUS 0xc820

0 comments on commit 12aba4e

Please sign in to comment.