Skip to content

Commit 337a0a0

Browse files
committed
Merge tag 'net-6.1-rc3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from bpf. The net-memcg fix stands out, the rest is very run-off-the-mill. Maybe I'm biased. Current release - regressions: - eth: fman: re-expose location of the MAC address to userspace, apparently some udev scripts depended on the exact value Current release - new code bugs: - bpf: - wait for busy refill_work when destroying bpf memory allocator - allow bpf_user_ringbuf_drain() callbacks to return 1 - fix dispatcher patchable function entry to 5 bytes nop Previous releases - regressions: - net-memcg: avoid stalls when under memory pressure - tcp: fix indefinite deferral of RTO with SACK reneging - tipc: fix a null-ptr-deref in tipc_topsrv_accept - eth: macb: specify PHY PM management done by MAC - tcp: fix a signed-integer-overflow bug in tcp_add_backlog() Previous releases - always broken: - eth: amd-xgbe: SFP fixes and compatibility improvements Misc: - docs: netdev: offer performance feedback to contributors" * tag 'net-6.1-rc3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (37 commits) net-memcg: avoid stalls when under memory pressure tcp: fix indefinite deferral of RTO with SACK reneging tcp: fix a signed-integer-overflow bug in tcp_add_backlog() net: lantiq_etop: don't free skb when returning NETDEV_TX_BUSY net: fix UAF issue in nfqnl_nf_hook_drop() when ops_init() failed docs: netdev: offer performance feedback to contributors kcm: annotate data-races around kcm->rx_wait kcm: annotate data-races around kcm->rx_psock net: fman: Use physical address for userspace interfaces net/mlx5e: Cleanup MACsec uninitialization routine atlantic: fix deadlock at aq_nic_stop nfp: only clean `sp_indiff` when application firmware is unloaded amd-xgbe: add the bit rate quirk for Molex cables amd-xgbe: fix the SFP compliance codes check for DAC cables amd-xgbe: enable PLL_CTL for fixed PHY modes only amd-xgbe: use enums for mailbox cmd and sub_cmds amd-xgbe: Yellow carp devices do not need rrc bpf: Use __llist_del_all() whenever possbile during memory draining bpf: Wait for busy refill_work when destroying bpf memory allocator MAINTAINERS: add keyword match on PTP ...
2 parents f6602a9 + 720ca52 commit 337a0a0

File tree

46 files changed

+336
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+336
-129
lines changed

Documentation/process/maintainer-netdev.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,13 @@ unpatched tree to confirm infrastructure didn't mangle it.
319319
Finally, go back and read
320320
:ref:`Documentation/process/submitting-patches.rst <submittingpatches>`
321321
to be sure you are not repeating some common mistake documented there.
322+
323+
My company uses peer feedback in employee performance reviews. Can I ask netdev maintainers for feedback?
324+
---------------------------------------------------------------------------------------------------------
325+
326+
Yes, especially if you spend significant amount of time reviewing code
327+
and go out of your way to improve shared infrastructure.
328+
329+
The feedback must be requested by you, the contributor, and will always
330+
be shared with you (even if you request for it to be submitted to your
331+
manager).

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16675,6 +16675,7 @@ F: Documentation/driver-api/ptp.rst
1667516675
F: drivers/net/phy/dp83640*
1667616676
F: drivers/ptp/*
1667716677
F: include/linux/ptp_cl*
16678+
K: (?:\b|_)ptp(?:\b|_)
1667816679

1667916680
PTP VIRTUAL CLOCK SUPPORT
1668016681
M: Yangbo Lu <[email protected]>

arch/x86/net/bpf_jit_comp.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/bpf.h>
1212
#include <linux/memory.h>
1313
#include <linux/sort.h>
14+
#include <linux/init.h>
1415
#include <asm/extable.h>
1516
#include <asm/set_memory.h>
1617
#include <asm/nospec-branch.h>
@@ -388,6 +389,18 @@ static int __bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t,
388389
return ret;
389390
}
390391

392+
int __init bpf_arch_init_dispatcher_early(void *ip)
393+
{
394+
const u8 *nop_insn = x86_nops[5];
395+
396+
if (is_endbr(*(u32 *)ip))
397+
ip += ENDBR_INSN_SIZE;
398+
399+
if (memcmp(ip, nop_insn, X86_PATCH_SIZE))
400+
text_poke_early(ip, nop_insn, X86_PATCH_SIZE);
401+
return 0;
402+
}
403+
391404
int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t,
392405
void *old_addr, void *new_addr)
393406
{

drivers/net/ethernet/amd/xgbe/xgbe-pci.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ static int xgbe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
285285

286286
/* Yellow Carp devices do not need cdr workaround */
287287
pdata->vdata->an_cdr_workaround = 0;
288+
289+
/* Yellow Carp devices do not need rrc */
290+
pdata->vdata->enable_rrc = 0;
288291
} else {
289292
pdata->xpcs_window_def_reg = PCS_V2_WINDOW_DEF;
290293
pdata->xpcs_window_sel_reg = PCS_V2_WINDOW_SELECT;
@@ -483,6 +486,7 @@ static struct xgbe_version_data xgbe_v2a = {
483486
.tx_desc_prefetch = 5,
484487
.rx_desc_prefetch = 5,
485488
.an_cdr_workaround = 1,
489+
.enable_rrc = 1,
486490
};
487491

488492
static struct xgbe_version_data xgbe_v2b = {
@@ -498,6 +502,7 @@ static struct xgbe_version_data xgbe_v2b = {
498502
.tx_desc_prefetch = 5,
499503
.rx_desc_prefetch = 5,
500504
.an_cdr_workaround = 1,
505+
.enable_rrc = 1,
501506
};
502507

503508
static const struct pci_device_id xgbe_pci_table[] = {

drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ enum xgbe_sfp_speed {
239239
#define XGBE_SFP_BASE_BR_1GBE_MAX 0x0d
240240
#define XGBE_SFP_BASE_BR_10GBE_MIN 0x64
241241
#define XGBE_SFP_BASE_BR_10GBE_MAX 0x68
242+
#define XGBE_MOLEX_SFP_BASE_BR_10GBE_MAX 0x78
242243

243244
#define XGBE_SFP_BASE_CU_CABLE_LEN 18
244245

@@ -284,6 +285,8 @@ struct xgbe_sfp_eeprom {
284285
#define XGBE_BEL_FUSE_VENDOR "BEL-FUSE "
285286
#define XGBE_BEL_FUSE_PARTNO "1GBT-SFP06 "
286287

288+
#define XGBE_MOLEX_VENDOR "Molex Inc. "
289+
287290
struct xgbe_sfp_ascii {
288291
union {
289292
char vendor[XGBE_SFP_BASE_VENDOR_NAME_LEN + 1];
@@ -834,7 +837,11 @@ static bool xgbe_phy_sfp_bit_rate(struct xgbe_sfp_eeprom *sfp_eeprom,
834837
break;
835838
case XGBE_SFP_SPEED_10000:
836839
min = XGBE_SFP_BASE_BR_10GBE_MIN;
837-
max = XGBE_SFP_BASE_BR_10GBE_MAX;
840+
if (memcmp(&sfp_eeprom->base[XGBE_SFP_BASE_VENDOR_NAME],
841+
XGBE_MOLEX_VENDOR, XGBE_SFP_BASE_VENDOR_NAME_LEN) == 0)
842+
max = XGBE_MOLEX_SFP_BASE_BR_10GBE_MAX;
843+
else
844+
max = XGBE_SFP_BASE_BR_10GBE_MAX;
838845
break;
839846
default:
840847
return false;
@@ -1151,7 +1158,10 @@ static void xgbe_phy_sfp_parse_eeprom(struct xgbe_prv_data *pdata)
11511158
}
11521159

11531160
/* Determine the type of SFP */
1154-
if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_SR)
1161+
if (phy_data->sfp_cable == XGBE_SFP_CABLE_PASSIVE &&
1162+
xgbe_phy_sfp_bit_rate(sfp_eeprom, XGBE_SFP_SPEED_10000))
1163+
phy_data->sfp_base = XGBE_SFP_BASE_10000_CR;
1164+
else if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_SR)
11551165
phy_data->sfp_base = XGBE_SFP_BASE_10000_SR;
11561166
else if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_LR)
11571167
phy_data->sfp_base = XGBE_SFP_BASE_10000_LR;
@@ -1167,9 +1177,6 @@ static void xgbe_phy_sfp_parse_eeprom(struct xgbe_prv_data *pdata)
11671177
phy_data->sfp_base = XGBE_SFP_BASE_1000_CX;
11681178
else if (sfp_base[XGBE_SFP_BASE_1GBE_CC] & XGBE_SFP_BASE_1GBE_CC_T)
11691179
phy_data->sfp_base = XGBE_SFP_BASE_1000_T;
1170-
else if ((phy_data->sfp_cable == XGBE_SFP_CABLE_PASSIVE) &&
1171-
xgbe_phy_sfp_bit_rate(sfp_eeprom, XGBE_SFP_SPEED_10000))
1172-
phy_data->sfp_base = XGBE_SFP_BASE_10000_CR;
11731180

11741181
switch (phy_data->sfp_base) {
11751182
case XGBE_SFP_BASE_1000_T:
@@ -1979,6 +1986,10 @@ static void xgbe_phy_rx_reset(struct xgbe_prv_data *pdata)
19791986

19801987
static void xgbe_phy_pll_ctrl(struct xgbe_prv_data *pdata, bool enable)
19811988
{
1989+
/* PLL_CTRL feature needs to be enabled for fixed PHY modes (Non-Autoneg) only */
1990+
if (pdata->phy.autoneg != AUTONEG_DISABLE)
1991+
return;
1992+
19821993
XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_VEND2_PMA_MISC_CTRL0,
19831994
XGBE_PMA_PLL_CTRL_MASK,
19841995
enable ? XGBE_PMA_PLL_CTRL_ENABLE
@@ -1989,7 +2000,7 @@ static void xgbe_phy_pll_ctrl(struct xgbe_prv_data *pdata, bool enable)
19892000
}
19902001

19912002
static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
1992-
unsigned int cmd, unsigned int sub_cmd)
2003+
enum xgbe_mb_cmd cmd, enum xgbe_mb_subcmd sub_cmd)
19932004
{
19942005
unsigned int s0 = 0;
19952006
unsigned int wait;
@@ -2029,14 +2040,16 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
20292040
xgbe_phy_rx_reset(pdata);
20302041

20312042
reenable_pll:
2032-
/* Enable PLL re-initialization */
2033-
xgbe_phy_pll_ctrl(pdata, true);
2043+
/* Enable PLL re-initialization, not needed for PHY Power Off and RRC cmds */
2044+
if (cmd != XGBE_MB_CMD_POWER_OFF &&
2045+
cmd != XGBE_MB_CMD_RRC)
2046+
xgbe_phy_pll_ctrl(pdata, true);
20342047
}
20352048

20362049
static void xgbe_phy_rrc(struct xgbe_prv_data *pdata)
20372050
{
20382051
/* Receiver Reset Cycle */
2039-
xgbe_phy_perform_ratechange(pdata, 5, 0);
2052+
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_RRC, XGBE_MB_SUBCMD_NONE);
20402053

20412054
netif_dbg(pdata, link, pdata->netdev, "receiver reset complete\n");
20422055
}
@@ -2046,7 +2059,7 @@ static void xgbe_phy_power_off(struct xgbe_prv_data *pdata)
20462059
struct xgbe_phy_data *phy_data = pdata->phy_data;
20472060

20482061
/* Power off */
2049-
xgbe_phy_perform_ratechange(pdata, 0, 0);
2062+
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_POWER_OFF, XGBE_MB_SUBCMD_NONE);
20502063

20512064
phy_data->cur_mode = XGBE_MODE_UNKNOWN;
20522065

@@ -2061,14 +2074,17 @@ static void xgbe_phy_sfi_mode(struct xgbe_prv_data *pdata)
20612074

20622075
/* 10G/SFI */
20632076
if (phy_data->sfp_cable != XGBE_SFP_CABLE_PASSIVE) {
2064-
xgbe_phy_perform_ratechange(pdata, 3, 0);
2077+
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI, XGBE_MB_SUBCMD_ACTIVE);
20652078
} else {
20662079
if (phy_data->sfp_cable_len <= 1)
2067-
xgbe_phy_perform_ratechange(pdata, 3, 1);
2080+
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI,
2081+
XGBE_MB_SUBCMD_PASSIVE_1M);
20682082
else if (phy_data->sfp_cable_len <= 3)
2069-
xgbe_phy_perform_ratechange(pdata, 3, 2);
2083+
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI,
2084+
XGBE_MB_SUBCMD_PASSIVE_3M);
20702085
else
2071-
xgbe_phy_perform_ratechange(pdata, 3, 3);
2086+
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI,
2087+
XGBE_MB_SUBCMD_PASSIVE_OTHER);
20722088
}
20732089

20742090
phy_data->cur_mode = XGBE_MODE_SFI;
@@ -2083,7 +2099,7 @@ static void xgbe_phy_x_mode(struct xgbe_prv_data *pdata)
20832099
xgbe_phy_set_redrv_mode(pdata);
20842100

20852101
/* 1G/X */
2086-
xgbe_phy_perform_ratechange(pdata, 1, 3);
2102+
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_1G_KX);
20872103

20882104
phy_data->cur_mode = XGBE_MODE_X;
20892105

@@ -2097,7 +2113,7 @@ static void xgbe_phy_sgmii_1000_mode(struct xgbe_prv_data *pdata)
20972113
xgbe_phy_set_redrv_mode(pdata);
20982114

20992115
/* 1G/SGMII */
2100-
xgbe_phy_perform_ratechange(pdata, 1, 2);
2116+
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_1G_SGMII);
21012117

21022118
phy_data->cur_mode = XGBE_MODE_SGMII_1000;
21032119

@@ -2111,7 +2127,7 @@ static void xgbe_phy_sgmii_100_mode(struct xgbe_prv_data *pdata)
21112127
xgbe_phy_set_redrv_mode(pdata);
21122128

21132129
/* 100M/SGMII */
2114-
xgbe_phy_perform_ratechange(pdata, 1, 1);
2130+
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_100MBITS);
21152131

21162132
phy_data->cur_mode = XGBE_MODE_SGMII_100;
21172133

@@ -2125,7 +2141,7 @@ static void xgbe_phy_kr_mode(struct xgbe_prv_data *pdata)
21252141
xgbe_phy_set_redrv_mode(pdata);
21262142

21272143
/* 10G/KR */
2128-
xgbe_phy_perform_ratechange(pdata, 4, 0);
2144+
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_KR, XGBE_MB_SUBCMD_NONE);
21292145

21302146
phy_data->cur_mode = XGBE_MODE_KR;
21312147

@@ -2139,7 +2155,7 @@ static void xgbe_phy_kx_2500_mode(struct xgbe_prv_data *pdata)
21392155
xgbe_phy_set_redrv_mode(pdata);
21402156

21412157
/* 2.5G/KX */
2142-
xgbe_phy_perform_ratechange(pdata, 2, 0);
2158+
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_2_5G, XGBE_MB_SUBCMD_NONE);
21432159

21442160
phy_data->cur_mode = XGBE_MODE_KX_2500;
21452161

@@ -2153,7 +2169,7 @@ static void xgbe_phy_kx_1000_mode(struct xgbe_prv_data *pdata)
21532169
xgbe_phy_set_redrv_mode(pdata);
21542170

21552171
/* 1G/KX */
2156-
xgbe_phy_perform_ratechange(pdata, 1, 3);
2172+
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_1G_KX);
21572173

21582174
phy_data->cur_mode = XGBE_MODE_KX_1000;
21592175

@@ -2640,7 +2656,7 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart)
26402656
}
26412657

26422658
/* No link, attempt a receiver reset cycle */
2643-
if (phy_data->rrc_count++ > XGBE_RRC_FREQUENCY) {
2659+
if (pdata->vdata->enable_rrc && phy_data->rrc_count++ > XGBE_RRC_FREQUENCY) {
26442660
phy_data->rrc_count = 0;
26452661
xgbe_phy_rrc(pdata);
26462662
}

drivers/net/ethernet/amd/xgbe/xgbe.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,31 @@ enum xgbe_mdio_mode {
611611
XGBE_MDIO_MODE_CL45,
612612
};
613613

614+
enum xgbe_mb_cmd {
615+
XGBE_MB_CMD_POWER_OFF = 0,
616+
XGBE_MB_CMD_SET_1G,
617+
XGBE_MB_CMD_SET_2_5G,
618+
XGBE_MB_CMD_SET_10G_SFI,
619+
XGBE_MB_CMD_SET_10G_KR,
620+
XGBE_MB_CMD_RRC
621+
};
622+
623+
enum xgbe_mb_subcmd {
624+
XGBE_MB_SUBCMD_NONE = 0,
625+
626+
/* 10GbE SFP subcommands */
627+
XGBE_MB_SUBCMD_ACTIVE = 0,
628+
XGBE_MB_SUBCMD_PASSIVE_1M,
629+
XGBE_MB_SUBCMD_PASSIVE_3M,
630+
XGBE_MB_SUBCMD_PASSIVE_OTHER,
631+
632+
/* 1GbE Mode subcommands */
633+
XGBE_MB_SUBCMD_10MBITS = 0,
634+
XGBE_MB_SUBCMD_100MBITS,
635+
XGBE_MB_SUBCMD_1G_SGMII,
636+
XGBE_MB_SUBCMD_1G_KX
637+
};
638+
614639
struct xgbe_phy {
615640
struct ethtool_link_ksettings lks;
616641

@@ -1013,6 +1038,7 @@ struct xgbe_version_data {
10131038
unsigned int tx_desc_prefetch;
10141039
unsigned int rx_desc_prefetch;
10151040
unsigned int an_cdr_workaround;
1041+
unsigned int enable_rrc;
10161042
};
10171043

10181044
struct xgbe_prv_data {

0 commit comments

Comments
 (0)