Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
Merge tag 'net-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/netdev/net

Pull networking fixes from Jakub Kicinski:
 "Including fixes from bpf and netfilter.

  A lot of networking people were at a conference last week, busy
  catching COVID, so relatively short PR.

  Current release - regressions:

   - tcp: process the 3rd ACK with sk_socket for TFO and MPTCP

  Current release - new code bugs:

   - l2tp: protect session IDR and tunnel session list with one lock,
     make sure the state is coherent to avoid a warning

   - eth: bnxt_en: update xdp_rxq_info in queue restart logic

   - eth: airoha: fix location of the MBI_RX_AGE_SEL_MASK field

  Previous releases - regressions:

   - xsk: require XDP_UMEM_TX_METADATA_LEN to actuate tx_metadata_len,
     the field reuses previously un-validated pad

  Previous releases - always broken:

   - tap/tun: drop short frames to prevent crashes later in the stack

   - eth: ice: add a per-VF limit on number of FDIR filters

   - af_unix: disable MSG_OOB handling for sockets in sockmap/sockhash"

* tag 'net-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (34 commits)
  tun: add missing verification for short frame
  tap: add missing verification for short frame
  mISDN: Fix a use after free in hfcmulti_tx()
  gve: Fix an edge case for TSO skb validity check
  bnxt_en: update xdp_rxq_info in queue restart logic
  tcp: process the 3rd ACK with sk_socket for TFO/MPTCP
  selftests/bpf: Add XDP_UMEM_TX_METADATA_LEN to XSK TX metadata test
  xsk: Require XDP_UMEM_TX_METADATA_LEN to actuate tx_metadata_len
  bpf: Fix a segment issue when downgrading gso_size
  net: mediatek: Fix potential NULL pointer dereference in dummy net_device handling
  MAINTAINERS: make Breno the netconsole maintainer
  MAINTAINERS: Update bonding entry
  net: nexthop: Initialize all fields in dumped nexthops
  net: stmmac: Correct byte order of perfect_match
  selftests: forwarding: skip if kernel not support setting bridge fdb learning limit
  tipc: Return non-zero value from tipc_udp_addr2str() on error
  netfilter: nft_set_pipapo_avx2: disable softinterrupts
  ice: Fix recipe read procedure
  ice: Add a per-VF limit on number of FDIR filters
  net: bonding: correctly annotate RCU in bond_should_notify_peers()
  ...
  • Loading branch information
torvalds committed Jul 25, 2024
2 parents 8bf1000 + af65ea4 commit 1722389
Show file tree
Hide file tree
Showing 43 changed files with 320 additions and 123 deletions.
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ Nadia Yvette Chambers <[email protected]> William Lee Irwin III <wli@holomorphy
Naoya Horiguchi <[email protected]> <[email protected]>
Naoya Horiguchi <[email protected]> <[email protected]>
Nathan Chancellor <[email protected]> <[email protected]>
Naveen N Rao <[email protected]> <[email protected]>
Naveen N Rao <[email protected]> <[email protected]>
Neeraj Upadhyay <[email protected]> <[email protected]>
Neeraj Upadhyay <[email protected]> <[email protected]>
Neil Armstrong <[email protected]> <[email protected]>
Expand Down
16 changes: 10 additions & 6 deletions Documentation/networking/xsk-tx-metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ metadata on the receive side.
General Design
==============

The headroom for the metadata is reserved via ``tx_metadata_len`` in
``struct xdp_umem_reg``. The metadata length is therefore the same for
every socket that shares the same umem. The metadata layout is a fixed UAPI,
refer to ``union xsk_tx_metadata`` in ``include/uapi/linux/if_xdp.h``.
Thus, generally, the ``tx_metadata_len`` field above should contain
``sizeof(union xsk_tx_metadata)``.
The headroom for the metadata is reserved via ``tx_metadata_len`` and
``XDP_UMEM_TX_METADATA_LEN`` flag in ``struct xdp_umem_reg``. The metadata
length is therefore the same for every socket that shares the same umem.
The metadata layout is a fixed UAPI, refer to ``union xsk_tx_metadata`` in
``include/uapi/linux/if_xdp.h``. Thus, generally, the ``tx_metadata_len``
field above should contain ``sizeof(union xsk_tx_metadata)``.

Note that in the original implementation the ``XDP_UMEM_TX_METADATA_LEN``
flag was not required. Applications might attempt to create a umem
with a flag first and if it fails, do another attempt without a flag.

The headroom and the metadata itself should be located right before
``xdp_desc->addr`` in the umem frame. Within a frame, the metadata
Expand Down
19 changes: 13 additions & 6 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3906,11 +3906,10 @@ F: include/net/bluetooth/
F: net/bluetooth/

BONDING DRIVER
M: Jay Vosburgh <[email protected]>
M: Jay Vosburgh <[email protected]>
M: Andy Gospodarek <[email protected]>
L: [email protected]
S: Supported
W: http://sourceforge.net/projects/bonding/
S: Maintained
F: Documentation/networking/bonding.rst
F: drivers/net/bonding/
F: include/net/bond*
Expand Down Expand Up @@ -3974,8 +3973,10 @@ S: Odd Fixes
F: drivers/net/ethernet/netronome/nfp/bpf/

BPF JIT for POWERPC (32-BIT AND 64-BIT)
M: Naveen N. Rao <[email protected]>
M: Michael Ellerman <[email protected]>
M: Hari Bathini <[email protected]>
M: Christophe Leroy <[email protected]>
R: Naveen N Rao <[email protected]>
L: [email protected]
S: Supported
F: arch/powerpc/net/
Expand Down Expand Up @@ -12529,7 +12530,7 @@ F: mm/kmsan/
F: scripts/Makefile.kmsan

KPROBES
M: Naveen N. Rao <naveen[email protected]>
M: Naveen N Rao <naveen@kernel.org>
M: Anil S Keshavamurthy <[email protected]>
M: "David S. Miller" <[email protected]>
M: Masami Hiramatsu <[email protected]>
Expand Down Expand Up @@ -12906,7 +12907,7 @@ LINUX FOR POWERPC (32-BIT AND 64-BIT)
M: Michael Ellerman <[email protected]>
R: Nicholas Piggin <[email protected]>
R: Christophe Leroy <[email protected]>
R: Naveen N. Rao <naveen[email protected]>
R: Naveen N Rao <naveen@kernel.org>
L: [email protected]
S: Supported
W: https://github.com/linuxppc/wiki/wiki
Expand Down Expand Up @@ -15762,6 +15763,12 @@ S: Maintained
F: Documentation/devicetree/bindings/hwmon/nuvoton,nct6775.yaml
F: drivers/hwmon/nct6775-i2c.c

NETCONSOLE
M: Breno Leitao <[email protected]>
S: Maintained
F: Documentation/networking/netconsole.rst
F: drivers/net/netconsole.c

NETDEVSIM
M: Jakub Kicinski <[email protected]>
S: Maintained
Expand Down
7 changes: 4 additions & 3 deletions drivers/isdn/hardware/mISDN/hfcmulti.c
Original file line number Diff line number Diff line change
Expand Up @@ -1901,7 +1901,7 @@ hfcmulti_dtmf(struct hfc_multi *hc)
static void
hfcmulti_tx(struct hfc_multi *hc, int ch)
{
int i, ii, temp, len = 0;
int i, ii, temp, tmp_len, len = 0;
int Zspace, z1, z2; /* must be int for calculation */
int Fspace, f1, f2;
u_char *d;
Expand Down Expand Up @@ -2122,14 +2122,15 @@ hfcmulti_tx(struct hfc_multi *hc, int ch)
HFC_wait_nodebug(hc);
}

tmp_len = (*sp)->len;
dev_kfree_skb(*sp);
/* check for next frame */
if (bch && get_next_bframe(bch)) {
len = (*sp)->len;
len = tmp_len;
goto next_frame;
}
if (dch && get_next_dframe(dch)) {
len = (*sp)->len;
len = tmp_len;
goto next_frame;
}

Expand Down
7 changes: 2 additions & 5 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,13 +1121,10 @@ static struct slave *bond_find_best_slave(struct bonding *bond)
return bestslave;
}

/* must be called in RCU critical section or with RTNL held */
static bool bond_should_notify_peers(struct bonding *bond)
{
struct slave *slave;

rcu_read_lock();
slave = rcu_dereference(bond->curr_active_slave);
rcu_read_unlock();
struct slave *slave = rcu_dereference_rtnl(bond->curr_active_slave);

if (!slave || !bond->send_peer_notif ||
bond->send_peer_notif %
Expand Down
17 changes: 17 additions & 0 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -4052,6 +4052,7 @@ static void bnxt_reset_rx_ring_struct(struct bnxt *bp,

rxr->page_pool->p.napi = NULL;
rxr->page_pool = NULL;
memset(&rxr->xdp_rxq, 0, sizeof(struct xdp_rxq_info));

ring = &rxr->rx_ring_struct;
rmem = &ring->ring_mem;
Expand Down Expand Up @@ -15018,6 +15019,16 @@ static int bnxt_queue_mem_alloc(struct net_device *dev, void *qmem, int idx)
if (rc)
return rc;

rc = xdp_rxq_info_reg(&clone->xdp_rxq, bp->dev, idx, 0);
if (rc < 0)
goto err_page_pool_destroy;

rc = xdp_rxq_info_reg_mem_model(&clone->xdp_rxq,
MEM_TYPE_PAGE_POOL,
clone->page_pool);
if (rc)
goto err_rxq_info_unreg;

ring = &clone->rx_ring_struct;
rc = bnxt_alloc_ring(bp, &ring->ring_mem);
if (rc)
Expand Down Expand Up @@ -15047,6 +15058,9 @@ static int bnxt_queue_mem_alloc(struct net_device *dev, void *qmem, int idx)
bnxt_free_ring(bp, &clone->rx_agg_ring_struct.ring_mem);
err_free_rx_ring:
bnxt_free_ring(bp, &clone->rx_ring_struct.ring_mem);
err_rxq_info_unreg:
xdp_rxq_info_unreg(&clone->xdp_rxq);
err_page_pool_destroy:
clone->page_pool->p.napi = NULL;
page_pool_destroy(clone->page_pool);
clone->page_pool = NULL;
Expand All @@ -15062,6 +15076,8 @@ static void bnxt_queue_mem_free(struct net_device *dev, void *qmem)
bnxt_free_one_rx_ring(bp, rxr);
bnxt_free_one_rx_agg_ring(bp, rxr);

xdp_rxq_info_unreg(&rxr->xdp_rxq);

page_pool_destroy(rxr->page_pool);
rxr->page_pool = NULL;

Expand Down Expand Up @@ -15145,6 +15161,7 @@ static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
rxr->rx_sw_agg_prod = clone->rx_sw_agg_prod;
rxr->rx_next_cons = clone->rx_next_cons;
rxr->page_pool = clone->page_pool;
rxr->xdp_rxq = clone->xdp_rxq;

bnxt_copy_rx_ring(bp, rxr, clone);

Expand Down
22 changes: 21 additions & 1 deletion drivers/net/ethernet/google/gve/gve_tx_dqo.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,22 +866,42 @@ static bool gve_can_send_tso(const struct sk_buff *skb)
const int header_len = skb_tcp_all_headers(skb);
const int gso_size = shinfo->gso_size;
int cur_seg_num_bufs;
int prev_frag_size;
int cur_seg_size;
int i;

cur_seg_size = skb_headlen(skb) - header_len;
prev_frag_size = skb_headlen(skb);
cur_seg_num_bufs = cur_seg_size > 0;

for (i = 0; i < shinfo->nr_frags; i++) {
if (cur_seg_size >= gso_size) {
cur_seg_size %= gso_size;
cur_seg_num_bufs = cur_seg_size > 0;

if (prev_frag_size > GVE_TX_MAX_BUF_SIZE_DQO) {
int prev_frag_remain = prev_frag_size %
GVE_TX_MAX_BUF_SIZE_DQO;

/* If the last descriptor of the previous frag
* is less than cur_seg_size, the segment will
* span two descriptors in the previous frag.
* Since max gso size (9728) is less than
* GVE_TX_MAX_BUF_SIZE_DQO, it is impossible
* for the segment to span more than two
* descriptors.
*/
if (prev_frag_remain &&
cur_seg_size > prev_frag_remain)
cur_seg_num_bufs++;
}
}

if (unlikely(++cur_seg_num_bufs > max_bufs_per_seg))
return false;

cur_seg_size += skb_frag_size(&shinfo->frags[i]);
prev_frag_size = skb_frag_size(&shinfo->frags[i]);
cur_seg_size += prev_frag_size;
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ ice_parse_rx_flow_user_data(struct ethtool_rx_flow_spec *fsp,
*
* Returns the number of available flow director filters to this VSI
*/
static int ice_fdir_num_avail_fltr(struct ice_hw *hw, struct ice_vsi *vsi)
int ice_fdir_num_avail_fltr(struct ice_hw *hw, struct ice_vsi *vsi)
{
u16 vsi_num = ice_get_hw_vsi_num(hw, vsi->idx);
u16 num_guar;
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/intel/ice/ice_fdir.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ struct ice_fdir_base_pkt {
const u8 *tun_pkt;
};

struct ice_vsi;

int ice_alloc_fd_res_cntr(struct ice_hw *hw, u16 *cntr_id);
int ice_free_fd_res_cntr(struct ice_hw *hw, u16 cntr_id);
int ice_alloc_fd_guar_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr);
Expand All @@ -218,6 +220,7 @@ int
ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
u8 *pkt, bool frag, bool tun);
int ice_get_fdir_cnt_all(struct ice_hw *hw);
int ice_fdir_num_avail_fltr(struct ice_hw *hw, struct ice_vsi *vsi);
bool ice_fdir_is_dup_fltr(struct ice_hw *hw, struct ice_fdir_fltr *input);
bool ice_fdir_has_frag(enum ice_fltr_ptype flow);
struct ice_fdir_fltr *
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/intel/ice/ice_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -2400,10 +2400,10 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,

/* Propagate some data to the recipe database */
recps[idx].priority = root_bufs.content.act_ctrl_fwd_priority;
recps[idx].need_pass_l2 = root_bufs.content.act_ctrl &
ICE_AQ_RECIPE_ACT_NEED_PASS_L2;
recps[idx].allow_pass_l2 = root_bufs.content.act_ctrl &
ICE_AQ_RECIPE_ACT_ALLOW_PASS_L2;
recps[idx].need_pass_l2 = !!(root_bufs.content.act_ctrl &
ICE_AQ_RECIPE_ACT_NEED_PASS_L2);
recps[idx].allow_pass_l2 = !!(root_bufs.content.act_ctrl &
ICE_AQ_RECIPE_ACT_ALLOW_PASS_L2);
bitmap_zero(recps[idx].res_idxs, ICE_MAX_FV_WORDS);
if (root_bufs.content.result_indx & ICE_AQ_RECIPE_RESULT_EN) {
set_bit(root_bufs.content.result_indx &
Expand Down
16 changes: 16 additions & 0 deletions drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,8 @@ static void ice_vc_fdir_reset_cnt_all(struct ice_vf_fdir *fdir)
fdir->fdir_fltr_cnt[flow][0] = 0;
fdir->fdir_fltr_cnt[flow][1] = 0;
}

fdir->fdir_fltr_cnt_total = 0;
}

/**
Expand Down Expand Up @@ -1560,6 +1562,7 @@ ice_vc_add_fdir_fltr_post(struct ice_vf *vf, struct ice_vf_fdir_ctx *ctx,
resp->status = status;
resp->flow_id = conf->flow_id;
vf->fdir.fdir_fltr_cnt[conf->input.flow_type][is_tun]++;
vf->fdir.fdir_fltr_cnt_total++;

ret = ice_vc_send_msg_to_vf(vf, ctx->v_opcode, v_ret,
(u8 *)resp, len);
Expand Down Expand Up @@ -1624,6 +1627,7 @@ ice_vc_del_fdir_fltr_post(struct ice_vf *vf, struct ice_vf_fdir_ctx *ctx,
resp->status = status;
ice_vc_fdir_remove_entry(vf, conf, conf->flow_id);
vf->fdir.fdir_fltr_cnt[conf->input.flow_type][is_tun]--;
vf->fdir.fdir_fltr_cnt_total--;

ret = ice_vc_send_msg_to_vf(vf, ctx->v_opcode, v_ret,
(u8 *)resp, len);
Expand Down Expand Up @@ -1790,6 +1794,7 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg)
struct virtchnl_fdir_add *stat = NULL;
struct virtchnl_fdir_fltr_conf *conf;
enum virtchnl_status_code v_ret;
struct ice_vsi *vf_vsi;
struct device *dev;
struct ice_pf *pf;
int is_tun = 0;
Expand All @@ -1798,6 +1803,17 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg)

pf = vf->pf;
dev = ice_pf_to_dev(pf);
vf_vsi = ice_get_vf_vsi(vf);

#define ICE_VF_MAX_FDIR_FILTERS 128
if (!ice_fdir_num_avail_fltr(&pf->hw, vf_vsi) ||
vf->fdir.fdir_fltr_cnt_total >= ICE_VF_MAX_FDIR_FILTERS) {
v_ret = VIRTCHNL_STATUS_ERR_PARAM;
dev_err(dev, "Max number of FDIR filters for VF %d is reached\n",
vf->vf_id);
goto err_exit;
}

ret = ice_vc_fdir_param_check(vf, fltr->vsi_id);
if (ret) {
v_ret = VIRTCHNL_STATUS_ERR_PARAM;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ struct ice_vf_fdir_ctx {
struct ice_vf_fdir {
u16 fdir_fltr_cnt[ICE_FLTR_PTYPE_MAX][ICE_FD_HW_SEG_MAX];
int prof_entry_cnt[ICE_FLTR_PTYPE_MAX][ICE_FD_HW_SEG_MAX];
u16 fdir_fltr_cnt_total;
struct ice_fd_hw_prof **fdir_prof;

struct idr fdir_rule_idr;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mediatek/airoha_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
#define REG_FE_GDM_RX_ETH_L1023_CNT_H(_n) (GDM_BASE(_n) + 0x2fc)

#define REG_GDM2_CHN_RLS (GDM2_BASE + 0x20)
#define MBI_RX_AGE_SEL_MASK GENMASK(18, 17)
#define MBI_RX_AGE_SEL_MASK GENMASK(26, 25)
#define MBI_TX_AGE_SEL_MASK GENMASK(18, 17)

#define REG_GDM3_FWD_CFG GDM3_BASE
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/ethernet/mediatek/mtk_eth_soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4223,8 +4223,6 @@ static int mtk_free_dev(struct mtk_eth *eth)
metadata_dst_free(eth->dsa_meta[i]);
}

free_netdev(eth->dummy_dev);

return 0;
}

Expand Down Expand Up @@ -5090,6 +5088,7 @@ static void mtk_remove(struct platform_device *pdev)
netif_napi_del(&eth->tx_napi);
netif_napi_del(&eth->rx_napi);
mtk_cleanup(eth);
free_netdev(eth->dummy_dev);
mtk_mdio_cleanup(eth);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ static void dwmac4_set_mac_loopback(void __iomem *ioaddr, bool enable)
}

static void dwmac4_update_vlan_hash(struct mac_device_info *hw, u32 hash,
__le16 perfect_match, bool is_double)
u16 perfect_match, bool is_double)
{
void __iomem *ioaddr = hw->pcsr;
u32 value;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ static int dwxgmac2_rss_configure(struct mac_device_info *hw,
}

static void dwxgmac2_update_vlan_hash(struct mac_device_info *hw, u32 hash,
__le16 perfect_match, bool is_double)
u16 perfect_match, bool is_double)
{
void __iomem *ioaddr = hw->pcsr;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/hwif.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ struct stmmac_ops {
struct stmmac_rss *cfg, u32 num_rxq);
/* VLAN */
void (*update_vlan_hash)(struct mac_device_info *hw, u32 hash,
__le16 perfect_match, bool is_double);
u16 perfect_match, bool is_double);
void (*enable_vlan)(struct mac_device_info *hw, u32 type);
void (*rx_hw_vlan)(struct mac_device_info *hw, struct dma_desc *rx_desc,
struct sk_buff *skb);
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6641,7 +6641,7 @@ static u32 stmmac_vid_crc32_le(__le16 vid_le)
static int stmmac_vlan_update(struct stmmac_priv *priv, bool is_double)
{
u32 crc, hash = 0;
__le16 pmatch = 0;
u16 pmatch = 0;
int count = 0;
u16 vid = 0;

Expand All @@ -6656,7 +6656,7 @@ static int stmmac_vlan_update(struct stmmac_priv *priv, bool is_double)
if (count > 2) /* VID = 0 always passes filter */
return -EOPNOTSUPP;

pmatch = cpu_to_le16(vid);
pmatch = vid;
hash = 0;
}

Expand Down
Loading

0 comments on commit 1722389

Please sign in to comment.