Commit 89cdf9d5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull networking fixes from Jakub Kicinski:
 "Including fixes from netfilter and bpf.

  Current release - regressions:

   - sched: fix SKB_NOT_DROPPED_YET splat under debug config

  Current release - new code bugs:

   - tcp:
       - fix usec timestamps with TCP fastopen
       - fix possible out-of-bounds reads in tcp_hash_fail()
       - fix SYN option room calculation for TCP-AO

   - tcp_sigpool: fix some off by one bugs

   - bpf: fix compilation error without CGROUPS

   - ptp:
       - ptp_read() should not release queue
       - fix tsevqs corruption

  Previous releases - regressions:

   - llc: verify mac len before reading mac header

  Previous releases - always broken:

   - bpf:
       - fix check_stack_write_fixed_off() to correctly spill imm
       - fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END
       - check map->usercnt after timer->timer is assigned

   - dsa: lan9303: consequently nested-lock physical MDIO

   - dccp/tcp: call security_inet_conn_request() after setting IP addr

   - tg3: fix the TX ring stall due to incorrect full ring handling

   - phylink: initialize carrier state at creation

   - ice: fix direction of VF rules in switchdev mode

  Misc:

   - fill in a bunch of missing MODULE_DESCRIPTION()s, more to come"

* tag 'net-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (84 commits)
  net: ti: icss-iep: fix setting counter value
  ptp: fix corrupted list in ptp_open
  ptp: ptp_read should not release queue
  net_sched: sch_fq: better validate TCA_FQ_WEIGHTS and TCA_FQ_PRIOMAP
  net: kcm: fill in MODULE_DESCRIPTION()
  net/sched: act_ct: Always fill offloading tuple iifidx
  netfilter: nat: fix ipv6 nat redirect with mapped and scoped addresses
  netfilter: xt_recent: fix (increase) ipv6 literal buffer length
  ipvs: add missing module descriptions
  netfilter: nf_tables: remove catchall element in GC sync path
  netfilter: add missing module descriptions
  drivers/net/ppp: use standard array-copy-function
  net: enetc: shorten enetc_setup_xdp_prog() error message to fit NETLINK_MAX_FMTMSG_LEN
  virtio/vsock: Fix uninit-value in virtio_transport_recv_pkt()
  r8169: respect userspace disabling IFF_MULTICAST
  selftests/bpf: get trusted cgrp from bpf_iter__cgroup directly
  bpf: Let verifier consider {task,cgroup} is trusted in bpf_iter_reg
  net: phylink: initialize carrier state at creation
  test/vsock: add dobule bind connect test
  test/vsock: refactor vsock_accept
  ...
parents 3b220413 83b9dda8
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -37,16 +37,14 @@ prototype in a header for the wrapper kfunc.
An example is given below::

        /* Disables missing prototype warnings */
        __diag_push();
        __diag_ignore_all("-Wmissing-prototypes",
                          "Global kfuncs as their definitions will be in BTF");
        __bpf_kfunc_start_defs();

        __bpf_kfunc struct task_struct *bpf_find_get_task_by_vpid(pid_t nr)
        {
                return find_get_task_by_vpid(nr);
        }

        __diag_pop();
        __bpf_kfunc_end_defs();

A wrapper kfunc is often needed when we need to annotate parameters of the
kfunc. Otherwise one may directly make the kfunc visible to the BPF program by
+4 −0
Original line number Diff line number Diff line
@@ -71,6 +71,10 @@ definitions:
        name: roce-bit
      -
        name: migratable-bit
      -
        name: ipsec-crypto-bit
      -
        name: ipsec-packet-bit
  -
    type: enum
    name: sb-threshold-type
+2 −4
Original line number Diff line number Diff line
@@ -44,18 +44,16 @@ smcr_testlink_time - INTEGER

wmem - INTEGER
	Initial size of send buffer used by SMC sockets.
	The default value inherits from net.ipv4.tcp_wmem[1].

	The minimum value is 16KiB and there is no hard limit for max value, but
	only allowed 512KiB for SMC-R and 1MiB for SMC-D.

	Default: 16K
	Default: 64KiB

rmem - INTEGER
	Initial size of receive buffer (RMB) used by SMC sockets.
	The default value inherits from net.ipv4.tcp_rmem[1].

	The minimum value is 16KiB and there is no hard limit for max value, but
	only allowed 512KiB for SMC-R and 1MiB for SMC-D.

	Default: 128K
	Default: 64KiB
+2 −2
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ static int lan9303_mdio_write(void *ctx, uint32_t reg, uint32_t val)
	struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx;

	reg <<= 2; /* reg num to offset */
	mutex_lock(&sw_dev->device->bus->mdio_lock);
	mutex_lock_nested(&sw_dev->device->bus->mdio_lock, MDIO_MUTEX_NESTED);
	lan9303_mdio_real_write(sw_dev->device, reg, val & 0xffff);
	lan9303_mdio_real_write(sw_dev->device, reg + 2, (val >> 16) & 0xffff);
	mutex_unlock(&sw_dev->device->bus->mdio_lock);
@@ -50,7 +50,7 @@ static int lan9303_mdio_read(void *ctx, uint32_t reg, uint32_t *val)
	struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx;

	reg <<= 2; /* reg num to offset */
	mutex_lock(&sw_dev->device->bus->mdio_lock);
	mutex_lock_nested(&sw_dev->device->bus->mdio_lock, MDIO_MUTEX_NESTED);
	*val = lan9303_mdio_real_read(sw_dev->device, reg);
	*val |= (lan9303_mdio_real_read(sw_dev->device, reg + 2) << 16);
	mutex_unlock(&sw_dev->device->bus->mdio_lock);
+44 −12
Original line number Diff line number Diff line
@@ -6647,9 +6647,9 @@ static void tg3_tx(struct tg3_napi *tnapi)

	tnapi->tx_cons = sw_idx;

	/* Need to make the tx_cons update visible to tg3_start_xmit()
	/* Need to make the tx_cons update visible to __tg3_start_xmit()
	 * before checking for netif_queue_stopped().  Without the
	 * memory barrier, there is a small possibility that tg3_start_xmit()
	 * memory barrier, there is a small possibility that __tg3_start_xmit()
	 * will miss it and cause the queue to be stopped forever.
	 */
	smp_mb();
@@ -7889,7 +7889,7 @@ static bool tg3_tso_bug_gso_check(struct tg3_napi *tnapi, struct sk_buff *skb)
	return skb_shinfo(skb)->gso_segs < tnapi->tx_pending / 3;
}

static netdev_tx_t tg3_start_xmit(struct sk_buff *, struct net_device *);
static netdev_tx_t __tg3_start_xmit(struct sk_buff *, struct net_device *);

/* Use GSO to workaround all TSO packets that meet HW bug conditions
 * indicated in tg3_tx_frag_set()
@@ -7923,7 +7923,7 @@ static int tg3_tso_bug(struct tg3 *tp, struct tg3_napi *tnapi,

	skb_list_walk_safe(segs, seg, next) {
		skb_mark_not_on_list(seg);
		tg3_start_xmit(seg, tp->dev);
		__tg3_start_xmit(seg, tp->dev);
	}

tg3_tso_bug_end:
@@ -7933,7 +7933,7 @@ static int tg3_tso_bug(struct tg3 *tp, struct tg3_napi *tnapi,
}

/* hard_start_xmit for all devices */
static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
static netdev_tx_t __tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
	struct tg3 *tp = netdev_priv(dev);
	u32 len, entry, base_flags, mss, vlan = 0;
@@ -8182,11 +8182,6 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
			netif_tx_wake_queue(txq);
	}

	if (!netdev_xmit_more() || netif_xmit_stopped(txq)) {
		/* Packets are ready, update Tx producer idx on card. */
		tw32_tx_mbox(tnapi->prodmbox, entry);
	}

	return NETDEV_TX_OK;

dma_error:
@@ -8199,6 +8194,42 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
	return NETDEV_TX_OK;
}

static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
	struct netdev_queue *txq;
	u16 skb_queue_mapping;
	netdev_tx_t ret;

	skb_queue_mapping = skb_get_queue_mapping(skb);
	txq = netdev_get_tx_queue(dev, skb_queue_mapping);

	ret = __tg3_start_xmit(skb, dev);

	/* Notify the hardware that packets are ready by updating the TX ring
	 * tail pointer. We respect netdev_xmit_more() thus avoiding poking
	 * the hardware for every packet. To guarantee forward progress the TX
	 * ring must be drained when it is full as indicated by
	 * netif_xmit_stopped(). This needs to happen even when the current
	 * skb was dropped or rejected with NETDEV_TX_BUSY. Otherwise packets
	 * queued by previous __tg3_start_xmit() calls might get stuck in
	 * the queue forever.
	 */
	if (!netdev_xmit_more() || netif_xmit_stopped(txq)) {
		struct tg3_napi *tnapi;
		struct tg3 *tp;

		tp = netdev_priv(dev);
		tnapi = &tp->napi[skb_queue_mapping];

		if (tg3_flag(tp, ENABLE_TSS))
			tnapi++;

		tw32_tx_mbox(tnapi->prodmbox, tnapi->tx_prod);
	}

	return ret;
}

static void tg3_mac_loopback(struct tg3 *tp, bool enable)
{
	if (enable) {
@@ -17729,7 +17760,7 @@ static int tg3_init_one(struct pci_dev *pdev,
	 * device behind the EPB cannot support DMA addresses > 40-bit.
	 * On 64-bit systems with IOMMU, use 40-bit dma_mask.
	 * On 64-bit systems without IOMMU, use 64-bit dma_mask and
	 * do DMA address check in tg3_start_xmit().
	 * do DMA address check in __tg3_start_xmit().
	 */
	if (tg3_flag(tp, IS_5788))
		persist_dma_mask = dma_mask = DMA_BIT_MASK(32);
@@ -18127,6 +18158,7 @@ static void tg3_shutdown(struct pci_dev *pdev)
	if (netif_running(dev))
		dev_close(dev);

	if (system_state == SYSTEM_POWER_OFF)
		tg3_power_down(tp);

	rtnl_unlock();
Loading