Skip to content

Commit

Permalink
Merge tag 'net-6.1-rc3-1' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/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
  ...
  • Loading branch information
Linus Torvalds committed Oct 24, 2022
2 parents f6602a9 + 720ca52 commit 337a0a0
Show file tree
Hide file tree
Showing 46 changed files with 336 additions and 129 deletions.
10 changes: 10 additions & 0 deletions Documentation/process/maintainer-netdev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,13 @@ unpatched tree to confirm infrastructure didn't mangle it.
Finally, go back and read
:ref:`Documentation/process/submitting-patches.rst <submittingpatches>`
to be sure you are not repeating some common mistake documented there.

My company uses peer feedback in employee performance reviews. Can I ask netdev maintainers for feedback?
---------------------------------------------------------------------------------------------------------

Yes, especially if you spend significant amount of time reviewing code
and go out of your way to improve shared infrastructure.

The feedback must be requested by you, the contributor, and will always
be shared with you (even if you request for it to be submitted to your
manager).
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -16675,6 +16675,7 @@ F: Documentation/driver-api/ptp.rst
F: drivers/net/phy/dp83640*
F: drivers/ptp/*
F: include/linux/ptp_cl*
K: (?:\b|_)ptp(?:\b|_)

PTP VIRTUAL CLOCK SUPPORT
M: Yangbo Lu <yangbo.lu@nxp.com>
Expand Down
13 changes: 13 additions & 0 deletions arch/x86/net/bpf_jit_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/bpf.h>
#include <linux/memory.h>
#include <linux/sort.h>
#include <linux/init.h>
#include <asm/extable.h>
#include <asm/set_memory.h>
#include <asm/nospec-branch.h>
Expand Down Expand Up @@ -388,6 +389,18 @@ static int __bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t,
return ret;
}

int __init bpf_arch_init_dispatcher_early(void *ip)
{
const u8 *nop_insn = x86_nops[5];

if (is_endbr(*(u32 *)ip))
ip += ENDBR_INSN_SIZE;

if (memcmp(ip, nop_insn, X86_PATCH_SIZE))
text_poke_early(ip, nop_insn, X86_PATCH_SIZE);
return 0;
}

int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t,
void *old_addr, void *new_addr)
{
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/ethernet/amd/xgbe/xgbe-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ static int xgbe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)

/* Yellow Carp devices do not need cdr workaround */
pdata->vdata->an_cdr_workaround = 0;

/* Yellow Carp devices do not need rrc */
pdata->vdata->enable_rrc = 0;
} else {
pdata->xpcs_window_def_reg = PCS_V2_WINDOW_DEF;
pdata->xpcs_window_sel_reg = PCS_V2_WINDOW_SELECT;
Expand Down Expand Up @@ -483,6 +486,7 @@ static struct xgbe_version_data xgbe_v2a = {
.tx_desc_prefetch = 5,
.rx_desc_prefetch = 5,
.an_cdr_workaround = 1,
.enable_rrc = 1,
};

static struct xgbe_version_data xgbe_v2b = {
Expand All @@ -498,6 +502,7 @@ static struct xgbe_version_data xgbe_v2b = {
.tx_desc_prefetch = 5,
.rx_desc_prefetch = 5,
.an_cdr_workaround = 1,
.enable_rrc = 1,
};

static const struct pci_device_id xgbe_pci_table[] = {
Expand Down
58 changes: 37 additions & 21 deletions drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ enum xgbe_sfp_speed {
#define XGBE_SFP_BASE_BR_1GBE_MAX 0x0d
#define XGBE_SFP_BASE_BR_10GBE_MIN 0x64
#define XGBE_SFP_BASE_BR_10GBE_MAX 0x68
#define XGBE_MOLEX_SFP_BASE_BR_10GBE_MAX 0x78

#define XGBE_SFP_BASE_CU_CABLE_LEN 18

Expand Down Expand Up @@ -284,6 +285,8 @@ struct xgbe_sfp_eeprom {
#define XGBE_BEL_FUSE_VENDOR "BEL-FUSE "
#define XGBE_BEL_FUSE_PARTNO "1GBT-SFP06 "

#define XGBE_MOLEX_VENDOR "Molex Inc. "

struct xgbe_sfp_ascii {
union {
char vendor[XGBE_SFP_BASE_VENDOR_NAME_LEN + 1];
Expand Down Expand Up @@ -834,7 +837,11 @@ static bool xgbe_phy_sfp_bit_rate(struct xgbe_sfp_eeprom *sfp_eeprom,
break;
case XGBE_SFP_SPEED_10000:
min = XGBE_SFP_BASE_BR_10GBE_MIN;
max = XGBE_SFP_BASE_BR_10GBE_MAX;
if (memcmp(&sfp_eeprom->base[XGBE_SFP_BASE_VENDOR_NAME],
XGBE_MOLEX_VENDOR, XGBE_SFP_BASE_VENDOR_NAME_LEN) == 0)
max = XGBE_MOLEX_SFP_BASE_BR_10GBE_MAX;
else
max = XGBE_SFP_BASE_BR_10GBE_MAX;
break;
default:
return false;
Expand Down Expand Up @@ -1151,7 +1158,10 @@ static void xgbe_phy_sfp_parse_eeprom(struct xgbe_prv_data *pdata)
}

/* Determine the type of SFP */
if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_SR)
if (phy_data->sfp_cable == XGBE_SFP_CABLE_PASSIVE &&
xgbe_phy_sfp_bit_rate(sfp_eeprom, XGBE_SFP_SPEED_10000))
phy_data->sfp_base = XGBE_SFP_BASE_10000_CR;
else if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_SR)
phy_data->sfp_base = XGBE_SFP_BASE_10000_SR;
else if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_LR)
phy_data->sfp_base = XGBE_SFP_BASE_10000_LR;
Expand All @@ -1167,9 +1177,6 @@ static void xgbe_phy_sfp_parse_eeprom(struct xgbe_prv_data *pdata)
phy_data->sfp_base = XGBE_SFP_BASE_1000_CX;
else if (sfp_base[XGBE_SFP_BASE_1GBE_CC] & XGBE_SFP_BASE_1GBE_CC_T)
phy_data->sfp_base = XGBE_SFP_BASE_1000_T;
else if ((phy_data->sfp_cable == XGBE_SFP_CABLE_PASSIVE) &&
xgbe_phy_sfp_bit_rate(sfp_eeprom, XGBE_SFP_SPEED_10000))
phy_data->sfp_base = XGBE_SFP_BASE_10000_CR;

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

static void xgbe_phy_pll_ctrl(struct xgbe_prv_data *pdata, bool enable)
{
/* PLL_CTRL feature needs to be enabled for fixed PHY modes (Non-Autoneg) only */
if (pdata->phy.autoneg != AUTONEG_DISABLE)
return;

XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_VEND2_PMA_MISC_CTRL0,
XGBE_PMA_PLL_CTRL_MASK,
enable ? XGBE_PMA_PLL_CTRL_ENABLE
Expand All @@ -1989,7 +2000,7 @@ static void xgbe_phy_pll_ctrl(struct xgbe_prv_data *pdata, bool enable)
}

static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
unsigned int cmd, unsigned int sub_cmd)
enum xgbe_mb_cmd cmd, enum xgbe_mb_subcmd sub_cmd)
{
unsigned int s0 = 0;
unsigned int wait;
Expand Down Expand Up @@ -2029,14 +2040,16 @@ static void xgbe_phy_perform_ratechange(struct xgbe_prv_data *pdata,
xgbe_phy_rx_reset(pdata);

reenable_pll:
/* Enable PLL re-initialization */
xgbe_phy_pll_ctrl(pdata, true);
/* Enable PLL re-initialization, not needed for PHY Power Off and RRC cmds */
if (cmd != XGBE_MB_CMD_POWER_OFF &&
cmd != XGBE_MB_CMD_RRC)
xgbe_phy_pll_ctrl(pdata, true);
}

static void xgbe_phy_rrc(struct xgbe_prv_data *pdata)
{
/* Receiver Reset Cycle */
xgbe_phy_perform_ratechange(pdata, 5, 0);
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_RRC, XGBE_MB_SUBCMD_NONE);

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

/* Power off */
xgbe_phy_perform_ratechange(pdata, 0, 0);
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_POWER_OFF, XGBE_MB_SUBCMD_NONE);

phy_data->cur_mode = XGBE_MODE_UNKNOWN;

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

/* 10G/SFI */
if (phy_data->sfp_cable != XGBE_SFP_CABLE_PASSIVE) {
xgbe_phy_perform_ratechange(pdata, 3, 0);
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI, XGBE_MB_SUBCMD_ACTIVE);
} else {
if (phy_data->sfp_cable_len <= 1)
xgbe_phy_perform_ratechange(pdata, 3, 1);
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI,
XGBE_MB_SUBCMD_PASSIVE_1M);
else if (phy_data->sfp_cable_len <= 3)
xgbe_phy_perform_ratechange(pdata, 3, 2);
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI,
XGBE_MB_SUBCMD_PASSIVE_3M);
else
xgbe_phy_perform_ratechange(pdata, 3, 3);
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_SFI,
XGBE_MB_SUBCMD_PASSIVE_OTHER);
}

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

/* 1G/X */
xgbe_phy_perform_ratechange(pdata, 1, 3);
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_1G_KX);

phy_data->cur_mode = XGBE_MODE_X;

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

/* 1G/SGMII */
xgbe_phy_perform_ratechange(pdata, 1, 2);
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_1G_SGMII);

phy_data->cur_mode = XGBE_MODE_SGMII_1000;

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

/* 100M/SGMII */
xgbe_phy_perform_ratechange(pdata, 1, 1);
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_100MBITS);

phy_data->cur_mode = XGBE_MODE_SGMII_100;

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

/* 10G/KR */
xgbe_phy_perform_ratechange(pdata, 4, 0);
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_10G_KR, XGBE_MB_SUBCMD_NONE);

phy_data->cur_mode = XGBE_MODE_KR;

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

/* 2.5G/KX */
xgbe_phy_perform_ratechange(pdata, 2, 0);
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_2_5G, XGBE_MB_SUBCMD_NONE);

phy_data->cur_mode = XGBE_MODE_KX_2500;

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

/* 1G/KX */
xgbe_phy_perform_ratechange(pdata, 1, 3);
xgbe_phy_perform_ratechange(pdata, XGBE_MB_CMD_SET_1G, XGBE_MB_SUBCMD_1G_KX);

phy_data->cur_mode = XGBE_MODE_KX_1000;

Expand Down Expand Up @@ -2640,7 +2656,7 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart)
}

/* No link, attempt a receiver reset cycle */
if (phy_data->rrc_count++ > XGBE_RRC_FREQUENCY) {
if (pdata->vdata->enable_rrc && phy_data->rrc_count++ > XGBE_RRC_FREQUENCY) {
phy_data->rrc_count = 0;
xgbe_phy_rrc(pdata);
}
Expand Down
26 changes: 26 additions & 0 deletions drivers/net/ethernet/amd/xgbe/xgbe.h
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,31 @@ enum xgbe_mdio_mode {
XGBE_MDIO_MODE_CL45,
};

enum xgbe_mb_cmd {
XGBE_MB_CMD_POWER_OFF = 0,
XGBE_MB_CMD_SET_1G,
XGBE_MB_CMD_SET_2_5G,
XGBE_MB_CMD_SET_10G_SFI,
XGBE_MB_CMD_SET_10G_KR,
XGBE_MB_CMD_RRC
};

enum xgbe_mb_subcmd {
XGBE_MB_SUBCMD_NONE = 0,

/* 10GbE SFP subcommands */
XGBE_MB_SUBCMD_ACTIVE = 0,
XGBE_MB_SUBCMD_PASSIVE_1M,
XGBE_MB_SUBCMD_PASSIVE_3M,
XGBE_MB_SUBCMD_PASSIVE_OTHER,

/* 1GbE Mode subcommands */
XGBE_MB_SUBCMD_10MBITS = 0,
XGBE_MB_SUBCMD_100MBITS,
XGBE_MB_SUBCMD_1G_SGMII,
XGBE_MB_SUBCMD_1G_KX
};

struct xgbe_phy {
struct ethtool_link_ksettings lks;

Expand Down Expand Up @@ -1013,6 +1038,7 @@ struct xgbe_version_data {
unsigned int tx_desc_prefetch;
unsigned int rx_desc_prefetch;
unsigned int an_cdr_workaround;
unsigned int enable_rrc;
};

struct xgbe_prv_data {
Expand Down
Loading

0 comments on commit 337a0a0

Please sign in to comment.