mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge tag 'net-6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni:
"Including fixes from Bluetooth.
Current release - new code bugs:
- eth:
- txgbe: fix the issue of TX failure
- ngbe: specify IRQ vector when the number of VFs is 7
Previous releases - regressions:
- sched: always pass notifications when child class becomes empty
- ipv4: fix stat increase when udp early demux drops the packet
- bluetooth: prevent unintended pause by checking if advertising is active
- virtio: fix error reporting in virtqueue_resize
- eth:
- virtio-net:
- ensure the received length does not exceed allocated size
- fix the xsk frame's length check
- lan78xx: fix WARN in __netif_napi_del_locked on disconnect
Previous releases - always broken:
- bluetooth: mesh: check instances prior disabling advertising
- eth:
- idpf: convert control queue mutex to a spinlock
- dpaa2: fix xdp_rxq_info leak
- amd-xgbe: align CL37 AN sequence as per databook"
* tag 'net-6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (38 commits)
vsock/vmci: Clear the vmci transport packet properly when initializing it
dt-bindings: net: sophgo,sg2044-dwmac: Drop status from the example
net: ngbe: specify IRQ vector when the number of VFs is 7
net: wangxun: revert the adjustment of the IRQ vector sequence
net: txgbe: request MISC IRQ in ndo_open
virtio_net: Enforce minimum TX ring size for reliability
virtio_net: Cleanup '2+MAX_SKB_FRAGS'
virtio_ring: Fix error reporting in virtqueue_resize
virtio-net: xsk: rx: fix the frame's length check
virtio-net: use the check_mergeable_len helper
virtio-net: remove redundant truesize check with PAGE_SIZE
virtio-net: ensure the received length does not exceed allocated size
net: ipv4: fix stat increase when udp early demux drops the packet
net: libwx: fix the incorrect display of the queue number
amd-xgbe: do not double read link status
net/sched: Always pass notifications when child class becomes empty
nui: Fix dma_mapping_error() check
rose: fix dangling neighbour pointers in rose_rt_device_down()
enic: fix incorrect MTU comparison in enic_change_mtu()
amd-xgbe: align CL37 AN sequence as per databook
...
This commit is contained in:
@@ -80,6 +80,8 @@ examples:
|
||||
interrupt-parent = <&intc>;
|
||||
interrupts = <296 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "macirq";
|
||||
phy-handle = <&phy0>;
|
||||
phy-mode = "rgmii-id";
|
||||
resets = <&rst 30>;
|
||||
reset-names = "stmmaceth";
|
||||
snps,multicast-filter-bins = <0>;
|
||||
@@ -91,7 +93,6 @@ examples:
|
||||
snps,mtl-rx-config = <&gmac0_mtl_rx_setup>;
|
||||
snps,mtl-tx-config = <&gmac0_mtl_tx_setup>;
|
||||
snps,axi-config = <&gmac0_stmmac_axi_setup>;
|
||||
status = "disabled";
|
||||
|
||||
gmac0_mtl_rx_setup: rx-queues-config {
|
||||
snps,rx-queues-to-use = <8>;
|
||||
|
||||
@@ -16,11 +16,13 @@ User interface
|
||||
Creating a TLS connection
|
||||
-------------------------
|
||||
|
||||
First create a new TCP socket and set the TLS ULP.
|
||||
First create a new TCP socket and once the connection is established set the
|
||||
TLS ULP.
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
connect(sock, addr, addrlen);
|
||||
setsockopt(sock, SOL_TCP, TCP_ULP, "tls", sizeof("tls"));
|
||||
|
||||
Setting the TLS ULP allows us to set/get TLS socket options. Currently
|
||||
|
||||
@@ -312,7 +312,7 @@ Posting as one thread is discouraged because it confuses patchwork
|
||||
(as of patchwork 2.2.2).
|
||||
|
||||
Co-posting selftests
|
||||
--------------------
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Selftests should be part of the same series as the code changes.
|
||||
Specifically for fixes both code change and related test should go into
|
||||
|
||||
+7
-3
@@ -15550,6 +15550,7 @@ F: drivers/net/ethernet/mellanox/mlx4/en_*
|
||||
MELLANOX ETHERNET DRIVER (mlx5e)
|
||||
M: Saeed Mahameed <saeedm@nvidia.com>
|
||||
M: Tariq Toukan <tariqt@nvidia.com>
|
||||
M: Mark Bloch <mbloch@nvidia.com>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
W: https://www.nvidia.com/networking/
|
||||
@@ -15619,6 +15620,7 @@ MELLANOX MLX5 core VPI driver
|
||||
M: Saeed Mahameed <saeedm@nvidia.com>
|
||||
M: Leon Romanovsky <leonro@nvidia.com>
|
||||
M: Tariq Toukan <tariqt@nvidia.com>
|
||||
M: Mark Bloch <mbloch@nvidia.com>
|
||||
L: netdev@vger.kernel.org
|
||||
L: linux-rdma@vger.kernel.org
|
||||
S: Maintained
|
||||
@@ -21198,7 +21200,7 @@ M: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
|
||||
L: netdev@vger.kernel.org
|
||||
L: linux-renesas-soc@vger.kernel.org
|
||||
S: Maintained
|
||||
F: Documentation/devicetree/bindings/net/renesas,r9a09g057-gbeth.yaml
|
||||
F: Documentation/devicetree/bindings/net/renesas,rzv2h-gbeth.yaml
|
||||
F: drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
|
||||
|
||||
RENESAS RZ/V2H(P) USB2PHY PORT RESET DRIVER
|
||||
@@ -22586,9 +22588,11 @@ S: Maintained
|
||||
F: drivers/misc/sgi-xp/
|
||||
|
||||
SHARED MEMORY COMMUNICATIONS (SMC) SOCKETS
|
||||
M: D. Wythe <alibuda@linux.alibaba.com>
|
||||
M: Dust Li <dust.li@linux.alibaba.com>
|
||||
M: Sidraya Jayagond <sidraya@linux.ibm.com>
|
||||
M: Wenjia Zhang <wenjia@linux.ibm.com>
|
||||
M: Jan Karcher <jaka@linux.ibm.com>
|
||||
R: D. Wythe <alibuda@linux.alibaba.com>
|
||||
R: Mahanta Jambigi <mjambigi@linux.ibm.com>
|
||||
R: Tony Lu <tonylu@linux.alibaba.com>
|
||||
R: Wen Gu <guwen@linux.alibaba.com>
|
||||
L: linux-rdma@vger.kernel.org
|
||||
|
||||
@@ -1269,6 +1269,8 @@
|
||||
#define MDIO_VEND2_CTRL1_SS13 BIT(13)
|
||||
#endif
|
||||
|
||||
#define XGBE_VEND2_MAC_AUTO_SW BIT(9)
|
||||
|
||||
/* MDIO mask values */
|
||||
#define XGBE_AN_CL73_INT_CMPLT BIT(0)
|
||||
#define XGBE_AN_CL73_INC_LINK BIT(1)
|
||||
|
||||
@@ -266,6 +266,10 @@ static void xgbe_an37_set(struct xgbe_prv_data *pdata, bool enable,
|
||||
reg |= MDIO_VEND2_CTRL1_AN_RESTART;
|
||||
|
||||
XMDIO_WRITE(pdata, MDIO_MMD_VEND2, MDIO_CTRL1, reg);
|
||||
|
||||
reg = XMDIO_READ(pdata, MDIO_MMD_VEND2, MDIO_PCS_DIG_CTRL);
|
||||
reg |= XGBE_VEND2_MAC_AUTO_SW;
|
||||
XMDIO_WRITE(pdata, MDIO_MMD_VEND2, MDIO_PCS_DIG_CTRL, reg);
|
||||
}
|
||||
|
||||
static void xgbe_an37_restart(struct xgbe_prv_data *pdata)
|
||||
@@ -894,6 +898,11 @@ static void xgbe_an37_init(struct xgbe_prv_data *pdata)
|
||||
|
||||
netif_dbg(pdata, link, pdata->netdev, "CL37 AN (%s) initialized\n",
|
||||
(pdata->an_mode == XGBE_AN_MODE_CL37) ? "BaseX" : "SGMII");
|
||||
|
||||
reg = XMDIO_READ(pdata, MDIO_MMD_AN, MDIO_CTRL1);
|
||||
reg &= ~MDIO_AN_CTRL1_ENABLE;
|
||||
XMDIO_WRITE(pdata, MDIO_MMD_AN, MDIO_CTRL1, reg);
|
||||
|
||||
}
|
||||
|
||||
static void xgbe_an73_init(struct xgbe_prv_data *pdata)
|
||||
@@ -1295,6 +1304,10 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)
|
||||
|
||||
pdata->phy.link = pdata->phy_if.phy_impl.link_status(pdata,
|
||||
&an_restart);
|
||||
/* bail out if the link status register read fails */
|
||||
if (pdata->phy.link < 0)
|
||||
return;
|
||||
|
||||
if (an_restart) {
|
||||
xgbe_phy_config_aneg(pdata);
|
||||
goto adjust_link;
|
||||
|
||||
@@ -2746,8 +2746,7 @@ static bool xgbe_phy_valid_speed(struct xgbe_prv_data *pdata, int speed)
|
||||
static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart)
|
||||
{
|
||||
struct xgbe_phy_data *phy_data = pdata->phy_data;
|
||||
unsigned int reg;
|
||||
int ret;
|
||||
int reg, ret;
|
||||
|
||||
*an_restart = 0;
|
||||
|
||||
@@ -2781,11 +2780,20 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Link status is latched low, so read once to clear
|
||||
* and then read again to get current state
|
||||
reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
|
||||
if (reg < 0)
|
||||
return reg;
|
||||
|
||||
/* Link status is latched low so that momentary link drops
|
||||
* can be detected. If link was already down read again
|
||||
* to get the latest state.
|
||||
*/
|
||||
reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
|
||||
reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
|
||||
|
||||
if (!pdata->phy.link && !(reg & MDIO_STAT1_LSTATUS)) {
|
||||
reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
|
||||
if (reg < 0)
|
||||
return reg;
|
||||
}
|
||||
|
||||
if (pdata->en_rx_adap) {
|
||||
/* if the link is available and adaptation is done,
|
||||
@@ -2804,9 +2812,7 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart)
|
||||
xgbe_phy_set_mode(pdata, phy_data->cur_mode);
|
||||
}
|
||||
|
||||
/* check again for the link and adaptation status */
|
||||
reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
|
||||
if ((reg & MDIO_STAT1_LSTATUS) && pdata->rx_adapt_done)
|
||||
if (pdata->rx_adapt_done)
|
||||
return 1;
|
||||
} else if (reg & MDIO_STAT1_LSTATUS)
|
||||
return 1;
|
||||
|
||||
@@ -183,12 +183,12 @@
|
||||
#define XGBE_LINK_TIMEOUT 5
|
||||
#define XGBE_KR_TRAINING_WAIT_ITER 50
|
||||
|
||||
#define XGBE_SGMII_AN_LINK_STATUS BIT(1)
|
||||
#define XGBE_SGMII_AN_LINK_DUPLEX BIT(1)
|
||||
#define XGBE_SGMII_AN_LINK_SPEED (BIT(2) | BIT(3))
|
||||
#define XGBE_SGMII_AN_LINK_SPEED_10 0x00
|
||||
#define XGBE_SGMII_AN_LINK_SPEED_100 0x04
|
||||
#define XGBE_SGMII_AN_LINK_SPEED_1000 0x08
|
||||
#define XGBE_SGMII_AN_LINK_DUPLEX BIT(4)
|
||||
#define XGBE_SGMII_AN_LINK_STATUS BIT(4)
|
||||
|
||||
/* ECC correctable error notification window (seconds) */
|
||||
#define XGBE_ECC_LIMIT 60
|
||||
|
||||
@@ -1861,14 +1861,21 @@ static u16 atl1_alloc_rx_buffers(struct atl1_adapter *adapter)
|
||||
break;
|
||||
}
|
||||
|
||||
buffer_info->alloced = 1;
|
||||
buffer_info->skb = skb;
|
||||
buffer_info->length = (u16) adapter->rx_buffer_len;
|
||||
page = virt_to_page(skb->data);
|
||||
offset = offset_in_page(skb->data);
|
||||
buffer_info->dma = dma_map_page(&pdev->dev, page, offset,
|
||||
adapter->rx_buffer_len,
|
||||
DMA_FROM_DEVICE);
|
||||
if (dma_mapping_error(&pdev->dev, buffer_info->dma)) {
|
||||
kfree_skb(skb);
|
||||
adapter->soft_stats.rx_dropped++;
|
||||
break;
|
||||
}
|
||||
|
||||
buffer_info->alloced = 1;
|
||||
buffer_info->skb = skb;
|
||||
buffer_info->length = (u16)adapter->rx_buffer_len;
|
||||
|
||||
rfd_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
|
||||
rfd_desc->buf_len = cpu_to_le16(adapter->rx_buffer_len);
|
||||
rfd_desc->coalese = 0;
|
||||
@@ -2183,8 +2190,8 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
struct tx_packet_desc *ptpd)
|
||||
static bool atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
struct tx_packet_desc *ptpd)
|
||||
{
|
||||
struct atl1_tpd_ring *tpd_ring = &adapter->tpd_ring;
|
||||
struct atl1_buffer *buffer_info;
|
||||
@@ -2194,6 +2201,7 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
unsigned int nr_frags;
|
||||
unsigned int f;
|
||||
int retval;
|
||||
u16 first_mapped;
|
||||
u16 next_to_use;
|
||||
u16 data_len;
|
||||
u8 hdr_len;
|
||||
@@ -2201,6 +2209,7 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
buf_len -= skb->data_len;
|
||||
nr_frags = skb_shinfo(skb)->nr_frags;
|
||||
next_to_use = atomic_read(&tpd_ring->next_to_use);
|
||||
first_mapped = next_to_use;
|
||||
buffer_info = &tpd_ring->buffer_info[next_to_use];
|
||||
BUG_ON(buffer_info->skb);
|
||||
/* put skb in last TPD */
|
||||
@@ -2216,6 +2225,8 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
buffer_info->dma = dma_map_page(&adapter->pdev->dev, page,
|
||||
offset, hdr_len,
|
||||
DMA_TO_DEVICE);
|
||||
if (dma_mapping_error(&adapter->pdev->dev, buffer_info->dma))
|
||||
goto dma_err;
|
||||
|
||||
if (++next_to_use == tpd_ring->count)
|
||||
next_to_use = 0;
|
||||
@@ -2242,6 +2253,9 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
page, offset,
|
||||
buffer_info->length,
|
||||
DMA_TO_DEVICE);
|
||||
if (dma_mapping_error(&adapter->pdev->dev,
|
||||
buffer_info->dma))
|
||||
goto dma_err;
|
||||
if (++next_to_use == tpd_ring->count)
|
||||
next_to_use = 0;
|
||||
}
|
||||
@@ -2254,6 +2268,8 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
buffer_info->dma = dma_map_page(&adapter->pdev->dev, page,
|
||||
offset, buf_len,
|
||||
DMA_TO_DEVICE);
|
||||
if (dma_mapping_error(&adapter->pdev->dev, buffer_info->dma))
|
||||
goto dma_err;
|
||||
if (++next_to_use == tpd_ring->count)
|
||||
next_to_use = 0;
|
||||
}
|
||||
@@ -2277,6 +2293,9 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
buffer_info->dma = skb_frag_dma_map(&adapter->pdev->dev,
|
||||
frag, i * ATL1_MAX_TX_BUF_LEN,
|
||||
buffer_info->length, DMA_TO_DEVICE);
|
||||
if (dma_mapping_error(&adapter->pdev->dev,
|
||||
buffer_info->dma))
|
||||
goto dma_err;
|
||||
|
||||
if (++next_to_use == tpd_ring->count)
|
||||
next_to_use = 0;
|
||||
@@ -2285,6 +2304,22 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
|
||||
/* last tpd's buffer-info */
|
||||
buffer_info->skb = skb;
|
||||
|
||||
return true;
|
||||
|
||||
dma_err:
|
||||
while (first_mapped != next_to_use) {
|
||||
buffer_info = &tpd_ring->buffer_info[first_mapped];
|
||||
dma_unmap_page(&adapter->pdev->dev,
|
||||
buffer_info->dma,
|
||||
buffer_info->length,
|
||||
DMA_TO_DEVICE);
|
||||
buffer_info->dma = 0;
|
||||
|
||||
if (++first_mapped == tpd_ring->count)
|
||||
first_mapped = 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void atl1_tx_queue(struct atl1_adapter *adapter, u16 count,
|
||||
@@ -2355,10 +2390,8 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
|
||||
|
||||
len = skb_headlen(skb);
|
||||
|
||||
if (unlikely(skb->len <= 0)) {
|
||||
dev_kfree_skb_any(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
if (unlikely(skb->len <= 0))
|
||||
goto drop_packet;
|
||||
|
||||
nr_frags = skb_shinfo(skb)->nr_frags;
|
||||
for (f = 0; f < nr_frags; f++) {
|
||||
@@ -2371,10 +2404,9 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
|
||||
if (mss) {
|
||||
if (skb->protocol == htons(ETH_P_IP)) {
|
||||
proto_hdr_len = skb_tcp_all_headers(skb);
|
||||
if (unlikely(proto_hdr_len > len)) {
|
||||
dev_kfree_skb_any(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
if (unlikely(proto_hdr_len > len))
|
||||
goto drop_packet;
|
||||
|
||||
/* need additional TPD ? */
|
||||
if (proto_hdr_len != len)
|
||||
count += (len - proto_hdr_len +
|
||||
@@ -2406,23 +2438,26 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
|
||||
}
|
||||
|
||||
tso = atl1_tso(adapter, skb, ptpd);
|
||||
if (tso < 0) {
|
||||
dev_kfree_skb_any(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
if (tso < 0)
|
||||
goto drop_packet;
|
||||
|
||||
if (!tso) {
|
||||
ret_val = atl1_tx_csum(adapter, skb, ptpd);
|
||||
if (ret_val < 0) {
|
||||
dev_kfree_skb_any(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
if (ret_val < 0)
|
||||
goto drop_packet;
|
||||
}
|
||||
|
||||
atl1_tx_map(adapter, skb, ptpd);
|
||||
if (!atl1_tx_map(adapter, skb, ptpd))
|
||||
goto drop_packet;
|
||||
|
||||
atl1_tx_queue(adapter, count, ptpd);
|
||||
atl1_update_mailbox(adapter);
|
||||
return NETDEV_TX_OK;
|
||||
|
||||
drop_packet:
|
||||
adapter->soft_stats.tx_errors++;
|
||||
dev_kfree_skb_any(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
static int atl1_rings_clean(struct napi_struct *napi, int budget)
|
||||
|
||||
@@ -1864,10 +1864,10 @@ static int enic_change_mtu(struct net_device *netdev, int new_mtu)
|
||||
if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (netdev->mtu > enic->port_mtu)
|
||||
if (new_mtu > enic->port_mtu)
|
||||
netdev_warn(netdev,
|
||||
"interface MTU (%d) set higher than port MTU (%d)\n",
|
||||
netdev->mtu, enic->port_mtu);
|
||||
new_mtu, enic->port_mtu);
|
||||
|
||||
return _enic_change_mtu(netdev, new_mtu);
|
||||
}
|
||||
|
||||
@@ -3939,6 +3939,7 @@ static int dpaa2_eth_setup_rx_flow(struct dpaa2_eth_priv *priv,
|
||||
MEM_TYPE_PAGE_ORDER0, NULL);
|
||||
if (err) {
|
||||
dev_err(dev, "xdp_rxq_info_reg_mem_model failed\n");
|
||||
xdp_rxq_info_unreg(&fq->channel->xdp_rxq);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -4432,17 +4433,25 @@ static int dpaa2_eth_bind_dpni(struct dpaa2_eth_priv *priv)
|
||||
return -EINVAL;
|
||||
}
|
||||
if (err)
|
||||
return err;
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = dpni_get_qdid(priv->mc_io, 0, priv->mc_token,
|
||||
DPNI_QUEUE_TX, &priv->tx_qdid);
|
||||
if (err) {
|
||||
dev_err(dev, "dpni_get_qdid() failed\n");
|
||||
return err;
|
||||
goto out;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
while (i--) {
|
||||
if (priv->fq[i].type == DPAA2_RX_FQ &&
|
||||
xdp_rxq_info_is_reg(&priv->fq[i].channel->xdp_rxq))
|
||||
xdp_rxq_info_unreg(&priv->fq[i].channel->xdp_rxq);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Allocate rings for storing incoming frame descriptors */
|
||||
@@ -4825,6 +4834,17 @@ static void dpaa2_eth_del_ch_napi(struct dpaa2_eth_priv *priv)
|
||||
}
|
||||
}
|
||||
|
||||
static void dpaa2_eth_free_rx_xdp_rxq(struct dpaa2_eth_priv *priv)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < priv->num_fqs; i++) {
|
||||
if (priv->fq[i].type == DPAA2_RX_FQ &&
|
||||
xdp_rxq_info_is_reg(&priv->fq[i].channel->xdp_rxq))
|
||||
xdp_rxq_info_unreg(&priv->fq[i].channel->xdp_rxq);
|
||||
}
|
||||
}
|
||||
|
||||
static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
|
||||
{
|
||||
struct device *dev;
|
||||
@@ -5028,6 +5048,7 @@ err_alloc_percpu_extras:
|
||||
free_percpu(priv->percpu_stats);
|
||||
err_alloc_percpu_stats:
|
||||
dpaa2_eth_del_ch_napi(priv);
|
||||
dpaa2_eth_free_rx_xdp_rxq(priv);
|
||||
err_bind:
|
||||
dpaa2_eth_free_dpbps(priv);
|
||||
err_dpbp_setup:
|
||||
@@ -5080,6 +5101,7 @@ static void dpaa2_eth_remove(struct fsl_mc_device *ls_dev)
|
||||
free_percpu(priv->percpu_extras);
|
||||
|
||||
dpaa2_eth_del_ch_napi(priv);
|
||||
dpaa2_eth_free_rx_xdp_rxq(priv);
|
||||
dpaa2_eth_free_dpbps(priv);
|
||||
dpaa2_eth_free_dpio(priv);
|
||||
dpaa2_eth_free_dpni(priv);
|
||||
|
||||
@@ -96,7 +96,7 @@ static void idpf_ctlq_init_rxq_bufs(struct idpf_ctlq_info *cq)
|
||||
*/
|
||||
static void idpf_ctlq_shutdown(struct idpf_hw *hw, struct idpf_ctlq_info *cq)
|
||||
{
|
||||
mutex_lock(&cq->cq_lock);
|
||||
spin_lock(&cq->cq_lock);
|
||||
|
||||
/* free ring buffers and the ring itself */
|
||||
idpf_ctlq_dealloc_ring_res(hw, cq);
|
||||
@@ -104,8 +104,7 @@ static void idpf_ctlq_shutdown(struct idpf_hw *hw, struct idpf_ctlq_info *cq)
|
||||
/* Set ring_size to 0 to indicate uninitialized queue */
|
||||
cq->ring_size = 0;
|
||||
|
||||
mutex_unlock(&cq->cq_lock);
|
||||
mutex_destroy(&cq->cq_lock);
|
||||
spin_unlock(&cq->cq_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,7 +172,7 @@ int idpf_ctlq_add(struct idpf_hw *hw,
|
||||
|
||||
idpf_ctlq_init_regs(hw, cq, is_rxq);
|
||||
|
||||
mutex_init(&cq->cq_lock);
|
||||
spin_lock_init(&cq->cq_lock);
|
||||
|
||||
list_add(&cq->cq_list, &hw->cq_list_head);
|
||||
|
||||
@@ -272,7 +271,7 @@ int idpf_ctlq_send(struct idpf_hw *hw, struct idpf_ctlq_info *cq,
|
||||
int err = 0;
|
||||
int i;
|
||||
|
||||
mutex_lock(&cq->cq_lock);
|
||||
spin_lock(&cq->cq_lock);
|
||||
|
||||
/* Ensure there are enough descriptors to send all messages */
|
||||
num_desc_avail = IDPF_CTLQ_DESC_UNUSED(cq);
|
||||
@@ -332,7 +331,7 @@ int idpf_ctlq_send(struct idpf_hw *hw, struct idpf_ctlq_info *cq,
|
||||
wr32(hw, cq->reg.tail, cq->next_to_use);
|
||||
|
||||
err_unlock:
|
||||
mutex_unlock(&cq->cq_lock);
|
||||
spin_unlock(&cq->cq_lock);
|
||||
|
||||
return err;
|
||||
}
|
||||
@@ -364,7 +363,7 @@ int idpf_ctlq_clean_sq(struct idpf_ctlq_info *cq, u16 *clean_count,
|
||||
if (*clean_count > cq->ring_size)
|
||||
return -EBADR;
|
||||
|
||||
mutex_lock(&cq->cq_lock);
|
||||
spin_lock(&cq->cq_lock);
|
||||
|
||||
ntc = cq->next_to_clean;
|
||||
|
||||
@@ -397,7 +396,7 @@ int idpf_ctlq_clean_sq(struct idpf_ctlq_info *cq, u16 *clean_count,
|
||||
|
||||
cq->next_to_clean = ntc;
|
||||
|
||||
mutex_unlock(&cq->cq_lock);
|
||||
spin_unlock(&cq->cq_lock);
|
||||
|
||||
/* Return number of descriptors actually cleaned */
|
||||
*clean_count = i;
|
||||
@@ -435,7 +434,7 @@ int idpf_ctlq_post_rx_buffs(struct idpf_hw *hw, struct idpf_ctlq_info *cq,
|
||||
if (*buff_count > 0)
|
||||
buffs_avail = true;
|
||||
|
||||
mutex_lock(&cq->cq_lock);
|
||||
spin_lock(&cq->cq_lock);
|
||||
|
||||
if (tbp >= cq->ring_size)
|
||||
tbp = 0;
|
||||
@@ -524,7 +523,7 @@ post_buffs_out:
|
||||
wr32(hw, cq->reg.tail, cq->next_to_post);
|
||||
}
|
||||
|
||||
mutex_unlock(&cq->cq_lock);
|
||||
spin_unlock(&cq->cq_lock);
|
||||
|
||||
/* return the number of buffers that were not posted */
|
||||
*buff_count = *buff_count - i;
|
||||
@@ -552,7 +551,7 @@ int idpf_ctlq_recv(struct idpf_ctlq_info *cq, u16 *num_q_msg,
|
||||
u16 i;
|
||||
|
||||
/* take the lock before we start messing with the ring */
|
||||
mutex_lock(&cq->cq_lock);
|
||||
spin_lock(&cq->cq_lock);
|
||||
|
||||
ntc = cq->next_to_clean;
|
||||
|
||||
@@ -614,7 +613,7 @@ int idpf_ctlq_recv(struct idpf_ctlq_info *cq, u16 *num_q_msg,
|
||||
|
||||
cq->next_to_clean = ntc;
|
||||
|
||||
mutex_unlock(&cq->cq_lock);
|
||||
spin_unlock(&cq->cq_lock);
|
||||
|
||||
*num_q_msg = i;
|
||||
if (*num_q_msg == 0)
|
||||
|
||||
@@ -99,7 +99,7 @@ struct idpf_ctlq_info {
|
||||
|
||||
enum idpf_ctlq_type cq_type;
|
||||
int q_id;
|
||||
struct mutex cq_lock; /* control queue lock */
|
||||
spinlock_t cq_lock; /* control queue lock */
|
||||
/* used for interrupt processing */
|
||||
u16 next_to_use;
|
||||
u16 next_to_clean;
|
||||
|
||||
@@ -47,7 +47,7 @@ static u32 idpf_get_rxfh_key_size(struct net_device *netdev)
|
||||
struct idpf_vport_user_config_data *user_config;
|
||||
|
||||
if (!idpf_is_cap_ena_all(np->adapter, IDPF_RSS_CAPS, IDPF_CAP_RSS))
|
||||
return -EOPNOTSUPP;
|
||||
return 0;
|
||||
|
||||
user_config = &np->adapter->vport_config[np->vport_idx]->user_config;
|
||||
|
||||
@@ -66,7 +66,7 @@ static u32 idpf_get_rxfh_indir_size(struct net_device *netdev)
|
||||
struct idpf_vport_user_config_data *user_config;
|
||||
|
||||
if (!idpf_is_cap_ena_all(np->adapter, IDPF_RSS_CAPS, IDPF_CAP_RSS))
|
||||
return -EOPNOTSUPP;
|
||||
return 0;
|
||||
|
||||
user_config = &np->adapter->vport_config[np->vport_idx]->user_config;
|
||||
|
||||
|
||||
@@ -2314,8 +2314,12 @@ void *idpf_alloc_dma_mem(struct idpf_hw *hw, struct idpf_dma_mem *mem, u64 size)
|
||||
struct idpf_adapter *adapter = hw->back;
|
||||
size_t sz = ALIGN(size, 4096);
|
||||
|
||||
mem->va = dma_alloc_coherent(&adapter->pdev->dev, sz,
|
||||
&mem->pa, GFP_KERNEL);
|
||||
/* The control queue resources are freed under a spinlock, contiguous
|
||||
* pages will avoid IOMMU remapping and the use vmap (and vunmap in
|
||||
* dma_free_*() path.
|
||||
*/
|
||||
mem->va = dma_alloc_attrs(&adapter->pdev->dev, sz, &mem->pa,
|
||||
GFP_KERNEL, DMA_ATTR_FORCE_CONTIGUOUS);
|
||||
mem->size = sz;
|
||||
|
||||
return mem->va;
|
||||
@@ -2330,8 +2334,8 @@ void idpf_free_dma_mem(struct idpf_hw *hw, struct idpf_dma_mem *mem)
|
||||
{
|
||||
struct idpf_adapter *adapter = hw->back;
|
||||
|
||||
dma_free_coherent(&adapter->pdev->dev, mem->size,
|
||||
mem->va, mem->pa);
|
||||
dma_free_attrs(&adapter->pdev->dev, mem->size,
|
||||
mem->va, mem->pa, DMA_ATTR_FORCE_CONTIGUOUS);
|
||||
mem->size = 0;
|
||||
mem->va = NULL;
|
||||
mem->pa = 0;
|
||||
|
||||
@@ -7115,6 +7115,10 @@ static int igc_probe(struct pci_dev *pdev,
|
||||
adapter->port_num = hw->bus.func;
|
||||
adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
|
||||
|
||||
/* Disable ASPM L1.2 on I226 devices to avoid packet loss */
|
||||
if (igc_is_device_id_i226(hw))
|
||||
pci_disable_link_state(pdev, PCIE_LINK_STATE_L1_2);
|
||||
|
||||
err = pci_save_state(pdev);
|
||||
if (err)
|
||||
goto err_ioremap;
|
||||
@@ -7500,6 +7504,9 @@ static int __igc_resume(struct device *dev, bool rpm)
|
||||
pci_enable_wake(pdev, PCI_D3hot, 0);
|
||||
pci_enable_wake(pdev, PCI_D3cold, 0);
|
||||
|
||||
if (igc_is_device_id_i226(hw))
|
||||
pci_disable_link_state(pdev, PCIE_LINK_STATE_L1_2);
|
||||
|
||||
if (igc_init_interrupt_scheme(adapter, true)) {
|
||||
netdev_err(netdev, "Unable to allocate memory for queues\n");
|
||||
return -ENOMEM;
|
||||
@@ -7625,6 +7632,9 @@ static pci_ers_result_t igc_io_slot_reset(struct pci_dev *pdev)
|
||||
pci_enable_wake(pdev, PCI_D3hot, 0);
|
||||
pci_enable_wake(pdev, PCI_D3cold, 0);
|
||||
|
||||
if (igc_is_device_id_i226(hw))
|
||||
pci_disable_link_state_locked(pdev, PCIE_LINK_STATE_L1_2);
|
||||
|
||||
/* In case of PCI error, adapter loses its HW address
|
||||
* so we should re-assign it here.
|
||||
*/
|
||||
|
||||
@@ -3336,7 +3336,7 @@ static int niu_rbr_add_page(struct niu *np, struct rx_ring_info *rp,
|
||||
|
||||
addr = np->ops->map_page(np->device, page, 0,
|
||||
PAGE_SIZE, DMA_FROM_DEVICE);
|
||||
if (!addr) {
|
||||
if (np->ops->mapping_error(np->device, addr)) {
|
||||
__free_page(page);
|
||||
return -ENOMEM;
|
||||
}
|
||||
@@ -6676,6 +6676,8 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb,
|
||||
len = skb_headlen(skb);
|
||||
mapping = np->ops->map_single(np->device, skb->data,
|
||||
len, DMA_TO_DEVICE);
|
||||
if (np->ops->mapping_error(np->device, mapping))
|
||||
goto out_drop;
|
||||
|
||||
prod = rp->prod;
|
||||
|
||||
@@ -6717,6 +6719,8 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb,
|
||||
mapping = np->ops->map_page(np->device, skb_frag_page(frag),
|
||||
skb_frag_off(frag), len,
|
||||
DMA_TO_DEVICE);
|
||||
if (np->ops->mapping_error(np->device, mapping))
|
||||
goto out_unmap;
|
||||
|
||||
rp->tx_buffs[prod].skb = NULL;
|
||||
rp->tx_buffs[prod].mapping = mapping;
|
||||
@@ -6741,6 +6745,19 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb,
|
||||
out:
|
||||
return NETDEV_TX_OK;
|
||||
|
||||
out_unmap:
|
||||
while (i--) {
|
||||
const skb_frag_t *frag;
|
||||
|
||||
prod = PREVIOUS_TX(rp, prod);
|
||||
frag = &skb_shinfo(skb)->frags[i];
|
||||
np->ops->unmap_page(np->device, rp->tx_buffs[prod].mapping,
|
||||
skb_frag_size(frag), DMA_TO_DEVICE);
|
||||
}
|
||||
|
||||
np->ops->unmap_single(np->device, rp->tx_buffs[rp->prod].mapping,
|
||||
skb_headlen(skb), DMA_TO_DEVICE);
|
||||
|
||||
out_drop:
|
||||
rp->tx_errors++;
|
||||
kfree_skb(skb);
|
||||
@@ -9644,6 +9661,11 @@ static void niu_pci_unmap_single(struct device *dev, u64 dma_address,
|
||||
dma_unmap_single(dev, dma_address, size, direction);
|
||||
}
|
||||
|
||||
static int niu_pci_mapping_error(struct device *dev, u64 addr)
|
||||
{
|
||||
return dma_mapping_error(dev, addr);
|
||||
}
|
||||
|
||||
static const struct niu_ops niu_pci_ops = {
|
||||
.alloc_coherent = niu_pci_alloc_coherent,
|
||||
.free_coherent = niu_pci_free_coherent,
|
||||
@@ -9651,6 +9673,7 @@ static const struct niu_ops niu_pci_ops = {
|
||||
.unmap_page = niu_pci_unmap_page,
|
||||
.map_single = niu_pci_map_single,
|
||||
.unmap_single = niu_pci_unmap_single,
|
||||
.mapping_error = niu_pci_mapping_error,
|
||||
};
|
||||
|
||||
static void niu_driver_version(void)
|
||||
@@ -10019,6 +10042,11 @@ static void niu_phys_unmap_single(struct device *dev, u64 dma_address,
|
||||
/* Nothing to do. */
|
||||
}
|
||||
|
||||
static int niu_phys_mapping_error(struct device *dev, u64 dma_address)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static const struct niu_ops niu_phys_ops = {
|
||||
.alloc_coherent = niu_phys_alloc_coherent,
|
||||
.free_coherent = niu_phys_free_coherent,
|
||||
@@ -10026,6 +10054,7 @@ static const struct niu_ops niu_phys_ops = {
|
||||
.unmap_page = niu_phys_unmap_page,
|
||||
.map_single = niu_phys_map_single,
|
||||
.unmap_single = niu_phys_unmap_single,
|
||||
.mapping_error = niu_phys_mapping_error,
|
||||
};
|
||||
|
||||
static int niu_of_probe(struct platform_device *op)
|
||||
|
||||
@@ -2879,6 +2879,9 @@ struct tx_ring_info {
|
||||
#define NEXT_TX(tp, index) \
|
||||
(((index) + 1) < (tp)->pending ? ((index) + 1) : 0)
|
||||
|
||||
#define PREVIOUS_TX(tp, index) \
|
||||
(((index) - 1) >= 0 ? ((index) - 1) : (((tp)->pending) - 1))
|
||||
|
||||
static inline u32 niu_tx_avail(struct tx_ring_info *tp)
|
||||
{
|
||||
return (tp->pending -
|
||||
@@ -3140,6 +3143,7 @@ struct niu_ops {
|
||||
enum dma_data_direction direction);
|
||||
void (*unmap_single)(struct device *dev, u64 dma_address,
|
||||
size_t size, enum dma_data_direction direction);
|
||||
int (*mapping_error)(struct device *dev, u64 dma_address);
|
||||
};
|
||||
|
||||
struct niu_link_config {
|
||||
|
||||
@@ -1705,6 +1705,7 @@ static void wx_set_rss_queues(struct wx *wx)
|
||||
|
||||
clear_bit(WX_FLAG_FDIR_HASH, wx->flags);
|
||||
|
||||
wx->ring_feature[RING_F_FDIR].indices = 1;
|
||||
/* Use Flow Director in addition to RSS to ensure the best
|
||||
* distribution of flows across cores, even when an FDIR flow
|
||||
* isn't matched.
|
||||
@@ -1746,7 +1747,7 @@ static void wx_set_num_queues(struct wx *wx)
|
||||
*/
|
||||
static int wx_acquire_msix_vectors(struct wx *wx)
|
||||
{
|
||||
struct irq_affinity affd = { .pre_vectors = 1 };
|
||||
struct irq_affinity affd = { .post_vectors = 1 };
|
||||
int nvecs, i;
|
||||
|
||||
/* We start by asking for one vector per queue pair */
|
||||
@@ -1783,16 +1784,24 @@ static int wx_acquire_msix_vectors(struct wx *wx)
|
||||
return nvecs;
|
||||
}
|
||||
|
||||
wx->msix_entry->entry = 0;
|
||||
wx->msix_entry->vector = pci_irq_vector(wx->pdev, 0);
|
||||
nvecs -= 1;
|
||||
for (i = 0; i < nvecs; i++) {
|
||||
wx->msix_q_entries[i].entry = i;
|
||||
wx->msix_q_entries[i].vector = pci_irq_vector(wx->pdev, i + 1);
|
||||
wx->msix_q_entries[i].vector = pci_irq_vector(wx->pdev, i);
|
||||
}
|
||||
|
||||
wx->num_q_vectors = nvecs;
|
||||
|
||||
wx->msix_entry->entry = nvecs;
|
||||
wx->msix_entry->vector = pci_irq_vector(wx->pdev, nvecs);
|
||||
|
||||
if (test_bit(WX_FLAG_IRQ_VECTOR_SHARED, wx->flags)) {
|
||||
wx->msix_entry->entry = 0;
|
||||
wx->msix_entry->vector = pci_irq_vector(wx->pdev, 0);
|
||||
wx->msix_q_entries[0].entry = 0;
|
||||
wx->msix_q_entries[0].vector = pci_irq_vector(wx->pdev, 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2291,6 +2300,8 @@ static void wx_set_ivar(struct wx *wx, s8 direction,
|
||||
|
||||
if (direction == -1) {
|
||||
/* other causes */
|
||||
if (test_bit(WX_FLAG_IRQ_VECTOR_SHARED, wx->flags))
|
||||
msix_vector = 0;
|
||||
msix_vector |= WX_PX_IVAR_ALLOC_VAL;
|
||||
index = 0;
|
||||
ivar = rd32(wx, WX_PX_MISC_IVAR);
|
||||
@@ -2299,8 +2310,6 @@ static void wx_set_ivar(struct wx *wx, s8 direction,
|
||||
wr32(wx, WX_PX_MISC_IVAR, ivar);
|
||||
} else {
|
||||
/* tx or rx causes */
|
||||
if (!(wx->mac.type == wx_mac_em && wx->num_vfs == 7))
|
||||
msix_vector += 1; /* offset for queue vectors */
|
||||
msix_vector |= WX_PX_IVAR_ALLOC_VAL;
|
||||
index = ((16 * (queue & 1)) + (8 * direction));
|
||||
ivar = rd32(wx, WX_PX_IVAR(queue >> 1));
|
||||
@@ -2339,7 +2348,7 @@ void wx_write_eitr(struct wx_q_vector *q_vector)
|
||||
|
||||
itr_reg |= WX_PX_ITR_CNT_WDIS;
|
||||
|
||||
wr32(wx, WX_PX_ITR(v_idx + 1), itr_reg);
|
||||
wr32(wx, WX_PX_ITR(v_idx), itr_reg);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2392,9 +2401,9 @@ void wx_configure_vectors(struct wx *wx)
|
||||
wx_write_eitr(q_vector);
|
||||
}
|
||||
|
||||
wx_set_ivar(wx, -1, 0, 0);
|
||||
wx_set_ivar(wx, -1, 0, v_idx);
|
||||
if (pdev->msix_enabled)
|
||||
wr32(wx, WX_PX_ITR(0), 1950);
|
||||
wr32(wx, WX_PX_ITR(v_idx), 1950);
|
||||
}
|
||||
EXPORT_SYMBOL(wx_configure_vectors);
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ static void wx_sriov_clear_data(struct wx *wx)
|
||||
wr32m(wx, WX_PSR_VM_CTL, WX_PSR_VM_CTL_POOL_MASK, 0);
|
||||
wx->ring_feature[RING_F_VMDQ].offset = 0;
|
||||
|
||||
clear_bit(WX_FLAG_IRQ_VECTOR_SHARED, wx->flags);
|
||||
clear_bit(WX_FLAG_SRIOV_ENABLED, wx->flags);
|
||||
/* Disable VMDq flag so device will be set in NM mode */
|
||||
if (wx->ring_feature[RING_F_VMDQ].limit == 1)
|
||||
@@ -78,6 +79,9 @@ static int __wx_enable_sriov(struct wx *wx, u8 num_vfs)
|
||||
set_bit(WX_FLAG_SRIOV_ENABLED, wx->flags);
|
||||
dev_info(&wx->pdev->dev, "SR-IOV enabled with %d VFs\n", num_vfs);
|
||||
|
||||
if (num_vfs == 7 && wx->mac.type == wx_mac_em)
|
||||
set_bit(WX_FLAG_IRQ_VECTOR_SHARED, wx->flags);
|
||||
|
||||
/* Enable VMDq flag so device will be set in VM mode */
|
||||
set_bit(WX_FLAG_VMDQ_ENABLED, wx->flags);
|
||||
if (!wx->ring_feature[RING_F_VMDQ].limit)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user