mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Merge in late fixes in preparation for the net-next PR. Conflicts: include/net/sch_generic.ha6bd339dbb("net_sched: fix skb memory leak in deferred qdisc drops")ff2998f29f("net: sched: introduce qdisc-specific drop reason tracing") https://lore.kernel.org/adz0iX85FHMz0HdO@sirena.org.uk drivers/net/ethernet/airoha/airoha_eth.c1acdfbdb51("net: airoha: Fix VIP configuration for AN7583 SoC")bf3471e6e6("net: airoha: Make flow control source port mapping dependent on nbq parameter") Adjacent changes: drivers/net/ethernet/airoha/airoha_ppe.cf44218cd5e("net: airoha: Reset PPE cpu port configuration in airoha_ppe_hw_init()")7da62262ec("inet: add ip_local_port_step_width sysctl to improve port usage distribution") Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -3592,6 +3592,16 @@ E: wsalamon@tislabs.com
|
||||
E: wsalamon@nai.com
|
||||
D: portions of the Linux Security Module (LSM) framework and security modules
|
||||
|
||||
N: Salil Mehta
|
||||
E: salil.mehta@opnsrc.net
|
||||
D: Co-authored Huawei/HiSilicon Kunpeng 920 SoC HNS3 PF and VF 100G
|
||||
D: Ethernet driver
|
||||
D: Co-authored Huawei/HiSilicon Kunpeng 916 SoC HNS 10G Ethernet
|
||||
D: driver enhancements
|
||||
D: Maintained Huawei/HiSilicon HNS and HNS3 10G/100G Ethernet drivers
|
||||
D: for Kunpeng 916 family, 920 family of SoCs
|
||||
S: Cambridge, Cambridgeshire, United Kingdom
|
||||
|
||||
N: Robert Sanders
|
||||
E: gt8134b@prism.gatech.edu
|
||||
D: Dosemu
|
||||
|
||||
@@ -11534,7 +11534,6 @@ F: drivers/bus/hisi_lpc.c
|
||||
|
||||
HISILICON NETWORK SUBSYSTEM 3 DRIVER (HNS3)
|
||||
M: Jian Shen <shenjian15@huawei.com>
|
||||
M: Salil Mehta <salil.mehta@huawei.com>
|
||||
M: Jijie Shao <shaojijie@huawei.com>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
@@ -11549,7 +11548,6 @@ F: drivers/net/ethernet/hisilicon/hibmcge/
|
||||
|
||||
HISILICON NETWORK SUBSYSTEM DRIVER
|
||||
M: Jian Shen <shenjian15@huawei.com>
|
||||
M: Salil Mehta <salil.mehta@huawei.com>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
W: http://www.hisilicon.com
|
||||
|
||||
@@ -1379,7 +1379,7 @@ static int ucan_probe(struct usb_interface *intf,
|
||||
*/
|
||||
|
||||
/* Prepare Memory for control transfers */
|
||||
ctl_msg_buffer = devm_kzalloc(&udev->dev,
|
||||
ctl_msg_buffer = devm_kzalloc(&intf->dev,
|
||||
sizeof(union ucan_ctl_payload),
|
||||
GFP_KERNEL);
|
||||
if (!ctl_msg_buffer) {
|
||||
|
||||
@@ -107,19 +107,7 @@ static int airoha_set_vip_for_gdm_port(struct airoha_gdm_port *port,
|
||||
struct airoha_eth *eth = port->qdma->eth;
|
||||
u32 vip_port;
|
||||
|
||||
switch (port->id) {
|
||||
case AIROHA_GDM3_IDX:
|
||||
/* FIXME: handle XSI_PCIE1_PORT */
|
||||
vip_port = XSI_PCIE0_VIP_PORT_MASK;
|
||||
break;
|
||||
case AIROHA_GDM4_IDX:
|
||||
/* FIXME: handle XSI_USB_PORT */
|
||||
vip_port = XSI_ETH_VIP_PORT_MASK;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
vip_port = eth->soc->ops.get_vip_port(port, port->nbq);
|
||||
if (enable) {
|
||||
airoha_fe_set(eth, REG_FE_VIP_PORT_EN, vip_port);
|
||||
airoha_fe_set(eth, REG_FE_IFC_PORT_EN, vip_port);
|
||||
@@ -293,16 +281,18 @@ static void airoha_fe_pse_ports_init(struct airoha_eth *eth)
|
||||
[FE_PSE_PORT_GDM4] = 2,
|
||||
[FE_PSE_PORT_CDM5] = 2,
|
||||
};
|
||||
u32 all_rsv;
|
||||
int q;
|
||||
|
||||
all_rsv = airoha_fe_get_pse_all_rsv(eth);
|
||||
if (airoha_ppe_is_enabled(eth, 1)) {
|
||||
u32 all_rsv;
|
||||
|
||||
/* hw misses PPE2 oq rsv */
|
||||
all_rsv = airoha_fe_get_pse_all_rsv(eth);
|
||||
all_rsv += PSE_RSV_PAGES *
|
||||
pse_port_num_queues[FE_PSE_PORT_PPE2];
|
||||
airoha_fe_rmw(eth, REG_FE_PSE_BUF_SET, PSE_ALLRSV_MASK,
|
||||
FIELD_PREP(PSE_ALLRSV_MASK, all_rsv));
|
||||
}
|
||||
airoha_fe_set(eth, REG_FE_PSE_BUF_SET, all_rsv);
|
||||
|
||||
/* CMD1 */
|
||||
for (q = 0; q < pse_port_num_queues[FE_PSE_PORT_CDM1]; q++)
|
||||
@@ -584,7 +574,7 @@ static int airoha_qdma_fill_rx_queue(struct airoha_queue *q)
|
||||
static int airoha_qdma_get_gdm_port(struct airoha_eth *eth,
|
||||
struct airoha_qdma_desc *desc)
|
||||
{
|
||||
u32 port, sport, msg1 = le32_to_cpu(desc->msg1);
|
||||
u32 port, sport, msg1 = le32_to_cpu(READ_ONCE(desc->msg1));
|
||||
|
||||
sport = FIELD_GET(QDMA_ETH_RXMSG_SPORT_MASK, msg1);
|
||||
switch (sport) {
|
||||
@@ -612,21 +602,24 @@ static int airoha_qdma_rx_process(struct airoha_queue *q, int budget)
|
||||
while (done < budget) {
|
||||
struct airoha_queue_entry *e = &q->entry[q->tail];
|
||||
struct airoha_qdma_desc *desc = &q->desc[q->tail];
|
||||
u32 hash, reason, msg1 = le32_to_cpu(desc->msg1);
|
||||
struct page *page = virt_to_head_page(e->buf);
|
||||
u32 desc_ctrl = le32_to_cpu(desc->ctrl);
|
||||
u32 hash, reason, msg1, desc_ctrl;
|
||||
struct airoha_gdm_port *port;
|
||||
int data_len, len, p;
|
||||
struct page *page;
|
||||
|
||||
desc_ctrl = le32_to_cpu(READ_ONCE(desc->ctrl));
|
||||
if (!(desc_ctrl & QDMA_DESC_DONE_MASK))
|
||||
break;
|
||||
|
||||
dma_rmb();
|
||||
|
||||
q->tail = (q->tail + 1) % q->ndesc;
|
||||
q->queued--;
|
||||
|
||||
dma_sync_single_for_cpu(eth->dev, e->dma_addr,
|
||||
SKB_WITH_OVERHEAD(q->buf_size), dir);
|
||||
|
||||
page = virt_to_head_page(e->buf);
|
||||
len = FIELD_GET(QDMA_DESC_LEN_MASK, desc_ctrl);
|
||||
data_len = q->skb ? q->buf_size
|
||||
: SKB_WITH_OVERHEAD(q->buf_size);
|
||||
@@ -670,8 +663,8 @@ static int airoha_qdma_rx_process(struct airoha_queue *q, int budget)
|
||||
* DMA descriptor. Report DSA tag to the DSA stack
|
||||
* via skb dst info.
|
||||
*/
|
||||
u32 sptag = FIELD_GET(QDMA_ETH_RXMSG_SPTAG,
|
||||
le32_to_cpu(desc->msg0));
|
||||
u32 msg0 = le32_to_cpu(READ_ONCE(desc->msg0));
|
||||
u32 sptag = FIELD_GET(QDMA_ETH_RXMSG_SPTAG, msg0);
|
||||
|
||||
if (sptag < ARRAY_SIZE(port->dsa_meta) &&
|
||||
port->dsa_meta[sptag])
|
||||
@@ -679,6 +672,7 @@ static int airoha_qdma_rx_process(struct airoha_queue *q, int budget)
|
||||
&port->dsa_meta[sptag]->dst);
|
||||
}
|
||||
|
||||
msg1 = le32_to_cpu(READ_ONCE(desc->msg1));
|
||||
hash = FIELD_GET(AIROHA_RXD4_FOE_ENTRY, msg1);
|
||||
if (hash != AIROHA_RXD4_FOE_ENTRY)
|
||||
skb_set_hash(q->skb, jhash_1word(hash, 0),
|
||||
@@ -819,6 +813,11 @@ static void airoha_qdma_cleanup_rx_queue(struct airoha_queue *q)
|
||||
}
|
||||
|
||||
q->head = q->tail;
|
||||
/* Set RX_DMA_IDX to RX_CPU_IDX to notify the hw the QDMA RX ring is
|
||||
* empty.
|
||||
*/
|
||||
airoha_qdma_rmw(qdma, REG_RX_CPU_IDX(qid), RX_RING_CPU_IDX_MASK,
|
||||
FIELD_PREP(RX_RING_CPU_IDX_MASK, q->head));
|
||||
airoha_qdma_rmw(qdma, REG_RX_DMA_IDX(qid), RX_RING_DMA_IDX_MASK,
|
||||
FIELD_PREP(RX_RING_DMA_IDX_MASK, q->tail));
|
||||
}
|
||||
@@ -1727,7 +1726,7 @@ static int airoha_dev_set_macaddr(struct net_device *dev, void *p)
|
||||
static int airoha_set_gdm2_loopback(struct airoha_gdm_port *port)
|
||||
{
|
||||
struct airoha_eth *eth = port->qdma->eth;
|
||||
u32 val, pse_port, chan, nbq;
|
||||
u32 val, pse_port, chan;
|
||||
int src_port;
|
||||
|
||||
/* Forward the traffic to the proper GDM port */
|
||||
@@ -1757,9 +1756,7 @@ static int airoha_set_gdm2_loopback(struct airoha_gdm_port *port)
|
||||
airoha_fe_clear(eth, REG_FE_VIP_PORT_EN, BIT(AIROHA_GDM2_IDX));
|
||||
airoha_fe_clear(eth, REG_FE_IFC_PORT_EN, BIT(AIROHA_GDM2_IDX));
|
||||
|
||||
/* XXX: handle XSI_USB_PORT and XSI_PCE1_PORT */
|
||||
nbq = port->id == AIROHA_GDM3_IDX && airoha_is_7581(eth) ? 4 : 0;
|
||||
src_port = eth->soc->ops.get_src_port_id(port, nbq);
|
||||
src_port = eth->soc->ops.get_src_port_id(port, port->nbq);
|
||||
if (src_port < 0)
|
||||
return src_port;
|
||||
|
||||
@@ -1773,7 +1770,7 @@ static int airoha_set_gdm2_loopback(struct airoha_gdm_port *port)
|
||||
__field_prep(SP_CPORT_MASK(val), FE_PSE_PORT_CDM2));
|
||||
|
||||
if (port->id == AIROHA_GDM4_IDX && airoha_is_7581(eth)) {
|
||||
u32 mask = FC_ID_OF_SRC_PORT_MASK(nbq);
|
||||
u32 mask = FC_ID_OF_SRC_PORT_MASK(port->nbq);
|
||||
|
||||
airoha_fe_rmw(eth, REG_SRC_PORT_FC_MAP6, mask,
|
||||
__field_prep(mask, AIROHA_GDM2_IDX));
|
||||
@@ -2952,6 +2949,8 @@ static int airoha_alloc_gdm_port(struct airoha_eth *eth,
|
||||
port->eth = eth;
|
||||
port->dev = dev;
|
||||
port->id = id;
|
||||
/* XXX: Read nbq from DTS */
|
||||
port->nbq = id == AIROHA_GDM3_IDX && airoha_is_7581(eth) ? 4 : 0;
|
||||
eth->ports[p] = port;
|
||||
|
||||
return airoha_metadata_dst_alloc(port);
|
||||
@@ -3148,6 +3147,28 @@ static int airoha_en7581_get_src_port_id(struct airoha_gdm_port *port, int nbq)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static u32 airoha_en7581_get_vip_port(struct airoha_gdm_port *port, int nbq)
|
||||
{
|
||||
switch (port->id) {
|
||||
case AIROHA_GDM3_IDX:
|
||||
if (nbq == 4)
|
||||
return XSI_PCIE0_VIP_PORT_MASK;
|
||||
if (nbq == 5)
|
||||
return XSI_PCIE1_VIP_PORT_MASK;
|
||||
break;
|
||||
case AIROHA_GDM4_IDX:
|
||||
if (!nbq)
|
||||
return XSI_ETH_VIP_PORT_MASK;
|
||||
if (nbq == 1)
|
||||
return XSI_USB_VIP_PORT_MASK;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char * const an7583_xsi_rsts_names[] = {
|
||||
"xsi-mac",
|
||||
"hsi0-mac",
|
||||
@@ -3177,6 +3198,26 @@ static int airoha_an7583_get_src_port_id(struct airoha_gdm_port *port, int nbq)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static u32 airoha_an7583_get_vip_port(struct airoha_gdm_port *port, int nbq)
|
||||
{
|
||||
switch (port->id) {
|
||||
case AIROHA_GDM3_IDX:
|
||||
if (!nbq)
|
||||
return XSI_ETH_VIP_PORT_MASK;
|
||||
break;
|
||||
case AIROHA_GDM4_IDX:
|
||||
if (!nbq)
|
||||
return XSI_PCIE0_VIP_PORT_MASK;
|
||||
if (nbq == 1)
|
||||
return XSI_USB_VIP_PORT_MASK;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct airoha_eth_soc_data en7581_soc_data = {
|
||||
.version = 0x7581,
|
||||
.xsi_rsts_names = en7581_xsi_rsts_names,
|
||||
@@ -3184,6 +3225,7 @@ static const struct airoha_eth_soc_data en7581_soc_data = {
|
||||
.num_ppe = 2,
|
||||
.ops = {
|
||||
.get_src_port_id = airoha_en7581_get_src_port_id,
|
||||
.get_vip_port = airoha_en7581_get_vip_port,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -3194,6 +3236,7 @@ static const struct airoha_eth_soc_data an7583_soc_data = {
|
||||
.num_ppe = 1,
|
||||
.ops = {
|
||||
.get_src_port_id = airoha_an7583_get_src_port_id,
|
||||
.get_vip_port = airoha_an7583_get_vip_port,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -537,6 +537,7 @@ struct airoha_gdm_port {
|
||||
struct airoha_eth *eth;
|
||||
struct net_device *dev;
|
||||
int id;
|
||||
int nbq;
|
||||
|
||||
struct airoha_hw_stats stats;
|
||||
|
||||
@@ -577,6 +578,7 @@ struct airoha_eth_soc_data {
|
||||
int num_ppe;
|
||||
struct {
|
||||
int (*get_src_port_id)(struct airoha_gdm_port *port, int nbq);
|
||||
u32 (*get_vip_port)(struct airoha_gdm_port *port, int nbq);
|
||||
} ops;
|
||||
};
|
||||
|
||||
|
||||
@@ -125,13 +125,13 @@ static void airoha_ppe_hw_init(struct airoha_ppe *ppe)
|
||||
airoha_fe_rmw(eth, REG_PPE_BND_AGE0(i),
|
||||
PPE_BIND_AGE0_DELTA_NON_L4 |
|
||||
PPE_BIND_AGE0_DELTA_UDP,
|
||||
FIELD_PREP(PPE_BIND_AGE0_DELTA_NON_L4, 1) |
|
||||
FIELD_PREP(PPE_BIND_AGE0_DELTA_UDP, 12));
|
||||
FIELD_PREP(PPE_BIND_AGE0_DELTA_NON_L4, 60) |
|
||||
FIELD_PREP(PPE_BIND_AGE0_DELTA_UDP, 60));
|
||||
airoha_fe_rmw(eth, REG_PPE_BND_AGE1(i),
|
||||
PPE_BIND_AGE1_DELTA_TCP_FIN |
|
||||
PPE_BIND_AGE1_DELTA_TCP,
|
||||
FIELD_PREP(PPE_BIND_AGE1_DELTA_TCP_FIN, 1) |
|
||||
FIELD_PREP(PPE_BIND_AGE1_DELTA_TCP, 7));
|
||||
FIELD_PREP(PPE_BIND_AGE1_DELTA_TCP, 60));
|
||||
|
||||
airoha_fe_rmw(eth, REG_PPE_TB_HASH_CFG(i),
|
||||
PPE_SRAM_TABLE_EN_MASK |
|
||||
@@ -159,7 +159,15 @@ static void airoha_ppe_hw_init(struct airoha_ppe *ppe)
|
||||
FIELD_PREP(PPE_DRAM_TB_NUM_ENTRY_MASK,
|
||||
dram_num_entries));
|
||||
|
||||
airoha_fe_rmw(eth, REG_PPE_BIND_RATE(i),
|
||||
PPE_BIND_RATE_L2B_BIND_MASK |
|
||||
PPE_BIND_RATE_BIND_MASK,
|
||||
FIELD_PREP(PPE_BIND_RATE_L2B_BIND_MASK, 0x1e) |
|
||||
FIELD_PREP(PPE_BIND_RATE_BIND_MASK, 0x1e));
|
||||
|
||||
airoha_fe_wr(eth, REG_PPE_HASH_SEED(i), PPE_HASH_SEED);
|
||||
airoha_fe_clear(eth, REG_PPE_PPE_FLOW_CFG(i),
|
||||
PPE_FLOW_CFG_IP6_6RD_MASK);
|
||||
|
||||
for (p = 0; p < ARRAY_SIZE(eth->ports); p++) {
|
||||
struct airoha_gdm_port *port = eth->ports[p];
|
||||
|
||||
@@ -194,6 +194,7 @@ void bnge_rdma_aux_device_add(struct bnge_dev *bd)
|
||||
dev_warn(bd->dev, "Failed to add auxiliary device for ROCE\n");
|
||||
auxiliary_device_uninit(aux_dev);
|
||||
bd->flags &= ~BNGE_EN_ROCE;
|
||||
return;
|
||||
}
|
||||
|
||||
bd->auxr_dev->net = bd->netdev;
|
||||
|
||||
@@ -1819,15 +1819,15 @@ static struct enet_cb *bcmgenet_put_txcb(struct bcmgenet_priv *priv,
|
||||
{
|
||||
struct enet_cb *tx_cb_ptr;
|
||||
|
||||
tx_cb_ptr = ring->cbs;
|
||||
tx_cb_ptr += ring->write_ptr - ring->cb_ptr;
|
||||
|
||||
/* Rewinding local write pointer */
|
||||
if (ring->write_ptr == ring->cb_ptr)
|
||||
ring->write_ptr = ring->end_ptr;
|
||||
else
|
||||
ring->write_ptr--;
|
||||
|
||||
tx_cb_ptr = ring->cbs;
|
||||
tx_cb_ptr += ring->write_ptr - ring->cb_ptr;
|
||||
|
||||
return tx_cb_ptr;
|
||||
}
|
||||
|
||||
@@ -1985,6 +1985,7 @@ static unsigned int bcmgenet_tx_reclaim(struct net_device *dev,
|
||||
drop = (ring->prod_index - ring->c_index) & DMA_C_INDEX_MASK;
|
||||
released += drop;
|
||||
ring->prod_index = ring->c_index & DMA_C_INDEX_MASK;
|
||||
ring->free_bds += drop;
|
||||
while (drop--) {
|
||||
cb_ptr = bcmgenet_put_txcb(priv, ring);
|
||||
skb = cb_ptr->skb;
|
||||
@@ -1996,6 +1997,7 @@ static unsigned int bcmgenet_tx_reclaim(struct net_device *dev,
|
||||
}
|
||||
if (skb)
|
||||
dev_consume_skb_any(skb);
|
||||
netdev_tx_reset_queue(netdev_get_tx_queue(dev, ring->index));
|
||||
bcmgenet_tdma_ring_writel(priv, ring->index,
|
||||
ring->prod_index, TDMA_PROD_INDEX);
|
||||
wr_ptr = ring->write_ptr * WORDS_PER_BD(priv);
|
||||
@@ -3475,27 +3477,23 @@ static void bcmgenet_dump_tx_queue(struct bcmgenet_tx_ring *ring)
|
||||
static void bcmgenet_timeout(struct net_device *dev, unsigned int txqueue)
|
||||
{
|
||||
struct bcmgenet_priv *priv = netdev_priv(dev);
|
||||
u32 int1_enable = 0;
|
||||
unsigned int q;
|
||||
struct bcmgenet_tx_ring *ring = &priv->tx_rings[txqueue];
|
||||
struct netdev_queue *txq = netdev_get_tx_queue(dev, txqueue);
|
||||
|
||||
netif_dbg(priv, tx_err, dev, "bcmgenet_timeout\n");
|
||||
|
||||
for (q = 0; q <= priv->hw_params->tx_queues; q++)
|
||||
bcmgenet_dump_tx_queue(&priv->tx_rings[q]);
|
||||
bcmgenet_dump_tx_queue(ring);
|
||||
|
||||
bcmgenet_tx_reclaim_all(dev);
|
||||
bcmgenet_tx_reclaim(dev, ring, true);
|
||||
|
||||
for (q = 0; q <= priv->hw_params->tx_queues; q++)
|
||||
int1_enable |= (1 << q);
|
||||
/* Re-enable the TX interrupt for this ring */
|
||||
bcmgenet_intrl2_1_writel(priv, 1 << txqueue, INTRL2_CPU_MASK_CLEAR);
|
||||
|
||||
/* Re-enable TX interrupts if disabled */
|
||||
bcmgenet_intrl2_1_writel(priv, int1_enable, INTRL2_CPU_MASK_CLEAR);
|
||||
txq_trans_cond_update(txq);
|
||||
|
||||
netif_trans_update(dev);
|
||||
BCMGENET_STATS64_INC((&ring->stats64), errors);
|
||||
|
||||
BCMGENET_STATS64_INC((&priv->tx_rings[txqueue].stats64), errors);
|
||||
|
||||
netif_tx_wake_all_queues(dev);
|
||||
netif_tx_wake_queue(txq);
|
||||
}
|
||||
|
||||
#define MAX_MDF_FILTER 17
|
||||
|
||||
@@ -352,6 +352,11 @@ static int octep_vf_oq_check_hw_for_pkts(struct octep_vf_device *oct,
|
||||
return new_pkts;
|
||||
}
|
||||
|
||||
static inline u32 octep_vf_oq_next_idx(struct octep_vf_oq *oq, u32 idx)
|
||||
{
|
||||
return (idx + 1 == oq->max_count) ? 0 : idx + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* __octep_vf_oq_process_rx() - Process hardware Rx queue and push to stack.
|
||||
*
|
||||
@@ -409,30 +414,52 @@ static int __octep_vf_oq_process_rx(struct octep_vf_device *oct,
|
||||
data_offset = OCTEP_VF_OQ_RESP_HW_SIZE;
|
||||
rx_ol_flags = 0;
|
||||
}
|
||||
rx_bytes += buff_info->len;
|
||||
|
||||
if (buff_info->len <= oq->max_single_buffer_size) {
|
||||
skb = napi_build_skb((void *)resp_hw, PAGE_SIZE);
|
||||
if (!skb) {
|
||||
oq->stats->alloc_failures++;
|
||||
desc_used++;
|
||||
read_idx = octep_vf_oq_next_idx(oq, read_idx);
|
||||
continue;
|
||||
}
|
||||
rx_bytes += buff_info->len;
|
||||
skb_reserve(skb, data_offset);
|
||||
skb_put(skb, buff_info->len);
|
||||
read_idx++;
|
||||
desc_used++;
|
||||
if (read_idx == oq->max_count)
|
||||
read_idx = 0;
|
||||
read_idx = octep_vf_oq_next_idx(oq, read_idx);
|
||||
} else {
|
||||
struct skb_shared_info *shinfo;
|
||||
u16 data_len;
|
||||
|
||||
skb = napi_build_skb((void *)resp_hw, PAGE_SIZE);
|
||||
if (!skb) {
|
||||
oq->stats->alloc_failures++;
|
||||
desc_used++;
|
||||
read_idx = octep_vf_oq_next_idx(oq, read_idx);
|
||||
data_len = buff_info->len - oq->max_single_buffer_size;
|
||||
while (data_len) {
|
||||
dma_unmap_page(oq->dev, oq->desc_ring[read_idx].buffer_ptr,
|
||||
PAGE_SIZE, DMA_FROM_DEVICE);
|
||||
buff_info = (struct octep_vf_rx_buffer *)
|
||||
&oq->buff_info[read_idx];
|
||||
buff_info->page = NULL;
|
||||
if (data_len < oq->buffer_size)
|
||||
data_len = 0;
|
||||
else
|
||||
data_len -= oq->buffer_size;
|
||||
desc_used++;
|
||||
read_idx = octep_vf_oq_next_idx(oq, read_idx);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
rx_bytes += buff_info->len;
|
||||
skb_reserve(skb, data_offset);
|
||||
/* Head fragment includes response header(s);
|
||||
* subsequent fragments contains only data.
|
||||
*/
|
||||
skb_put(skb, oq->max_single_buffer_size);
|
||||
read_idx++;
|
||||
desc_used++;
|
||||
if (read_idx == oq->max_count)
|
||||
read_idx = 0;
|
||||
read_idx = octep_vf_oq_next_idx(oq, read_idx);
|
||||
|
||||
shinfo = skb_shinfo(skb);
|
||||
data_len = buff_info->len - oq->max_single_buffer_size;
|
||||
@@ -454,10 +481,8 @@ static int __octep_vf_oq_process_rx(struct octep_vf_device *oct,
|
||||
buff_info->len,
|
||||
buff_info->len);
|
||||
buff_info->page = NULL;
|
||||
read_idx++;
|
||||
desc_used++;
|
||||
if (read_idx == oq->max_count)
|
||||
read_idx = 0;
|
||||
read_idx = octep_vf_oq_next_idx(oq, read_idx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3588,12 +3588,23 @@ found:
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
static int mtk_max_gmac_mtu(struct mtk_eth *eth)
|
||||
{
|
||||
int i, max_mtu = ETH_DATA_LEN;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(eth->netdev); i++)
|
||||
if (eth->netdev[i] && eth->netdev[i]->mtu > max_mtu)
|
||||
max_mtu = eth->netdev[i]->mtu;
|
||||
|
||||
return max_mtu;
|
||||
}
|
||||
|
||||
static int mtk_open(struct net_device *dev)
|
||||
{
|
||||
struct mtk_mac *mac = netdev_priv(dev);
|
||||
struct mtk_eth *eth = mac->hw;
|
||||
struct mtk_mac *target_mac;
|
||||
int i, err, ppe_num;
|
||||
int i, err, ppe_num, mtu;
|
||||
|
||||
ppe_num = eth->soc->ppe_num;
|
||||
|
||||
@@ -3640,6 +3651,10 @@ static int mtk_open(struct net_device *dev)
|
||||
mtk_gdm_config(eth, target_mac->id, gdm_config);
|
||||
}
|
||||
|
||||
mtu = mtk_max_gmac_mtu(eth);
|
||||
for (i = 0; i < ARRAY_SIZE(eth->ppe); i++)
|
||||
mtk_ppe_update_mtu(eth->ppe[i], mtu);
|
||||
|
||||
napi_enable(ð->tx_napi);
|
||||
napi_enable(ð->rx_napi);
|
||||
mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
|
||||
@@ -4333,6 +4348,7 @@ static int mtk_change_mtu(struct net_device *dev, int new_mtu)
|
||||
int length = new_mtu + MTK_RX_ETH_HLEN;
|
||||
struct mtk_mac *mac = netdev_priv(dev);
|
||||
struct mtk_eth *eth = mac->hw;
|
||||
int max_mtu, i;
|
||||
|
||||
if (rcu_access_pointer(eth->prog) &&
|
||||
length > MTK_PP_MAX_BUF_SIZE) {
|
||||
@@ -4343,6 +4359,10 @@ static int mtk_change_mtu(struct net_device *dev, int new_mtu)
|
||||
mtk_set_mcr_max_rx(mac, length);
|
||||
WRITE_ONCE(dev->mtu, new_mtu);
|
||||
|
||||
max_mtu = mtk_max_gmac_mtu(eth);
|
||||
for (i = 0; i < ARRAY_SIZE(eth->ppe); i++)
|
||||
mtk_ppe_update_mtu(eth->ppe[i], max_mtu);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -973,6 +973,36 @@ static void mtk_ppe_init_foe_table(struct mtk_ppe *ppe)
|
||||
}
|
||||
}
|
||||
|
||||
void mtk_ppe_update_mtu(struct mtk_ppe *ppe, int mtu)
|
||||
{
|
||||
int base;
|
||||
u32 val;
|
||||
|
||||
if (!ppe)
|
||||
return;
|
||||
|
||||
/* The PPE checks output frame size against per-tag-layer MTU limits,
|
||||
* treating PPPoE and DSA tags just like 802.1Q VLAN tags. The Linux
|
||||
* device MTU already accounts for PPPoE (PPPOE_SES_HLEN) and DSA tag
|
||||
* overhead, but 802.1Q VLAN tags are handled transparently without
|
||||
* being reflected by the lower device MTU being increased by 4.
|
||||
* Use the maximum MTU across all GMAC interfaces so that PPE output
|
||||
* frame limits are sufficiently high regardless of which port a flow
|
||||
* egresses through.
|
||||
*/
|
||||
base = ETH_HLEN + mtu;
|
||||
|
||||
val = FIELD_PREP(MTK_PPE_VLAN_MTU0_NONE, base) |
|
||||
FIELD_PREP(MTK_PPE_VLAN_MTU0_1TAG, base + VLAN_HLEN);
|
||||
ppe_w32(ppe, MTK_PPE_VLAN_MTU0, val);
|
||||
|
||||
val = FIELD_PREP(MTK_PPE_VLAN_MTU1_2TAG,
|
||||
base + 2 * VLAN_HLEN) |
|
||||
FIELD_PREP(MTK_PPE_VLAN_MTU1_3TAG,
|
||||
base + 3 * VLAN_HLEN);
|
||||
ppe_w32(ppe, MTK_PPE_VLAN_MTU1, val);
|
||||
}
|
||||
|
||||
void mtk_ppe_start(struct mtk_ppe *ppe)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
@@ -346,6 +346,7 @@ struct mtk_ppe {
|
||||
struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, int index);
|
||||
|
||||
void mtk_ppe_deinit(struct mtk_eth *eth);
|
||||
void mtk_ppe_update_mtu(struct mtk_ppe *ppe, int mtu);
|
||||
void mtk_ppe_start(struct mtk_ppe *ppe);
|
||||
int mtk_ppe_stop(struct mtk_ppe *ppe);
|
||||
int mtk_ppe_prepare_reset(struct mtk_ppe *ppe);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
|
||||
/* Copyright (c) 2017, Mellanox Technologies inc. All rights reserved. */
|
||||
|
||||
#include <linux/iopoll.h>
|
||||
|
||||
#include "mlx5_core.h"
|
||||
#include "en.h"
|
||||
#include "ipsec.h"
|
||||
@@ -592,7 +594,6 @@ int mlx5e_ipsec_aso_query(struct mlx5e_ipsec_sa_entry *sa_entry,
|
||||
struct mlx5_wqe_aso_ctrl_seg *ctrl;
|
||||
struct mlx5e_hw_objs *res;
|
||||
struct mlx5_aso_wqe *wqe;
|
||||
unsigned long expires;
|
||||
u8 ds_cnt;
|
||||
int ret;
|
||||
|
||||
@@ -614,13 +615,8 @@ int mlx5e_ipsec_aso_query(struct mlx5e_ipsec_sa_entry *sa_entry,
|
||||
mlx5e_ipsec_aso_copy(ctrl, data);
|
||||
|
||||
mlx5_aso_post_wqe(aso->aso, false, &wqe->ctrl);
|
||||
expires = jiffies + msecs_to_jiffies(10);
|
||||
do {
|
||||
ret = mlx5_aso_poll_cq(aso->aso, false);
|
||||
if (ret)
|
||||
/* We are in atomic context */
|
||||
udelay(10);
|
||||
} while (ret && time_is_after_jiffies(expires));
|
||||
read_poll_timeout_atomic(mlx5_aso_poll_cq, ret, !ret, 10,
|
||||
10 * USEC_PER_MSEC, false, aso->aso, false);
|
||||
if (!ret)
|
||||
memcpy(sa_entry->ctx, aso->ctx, MLX5_ST_SZ_BYTES(ipsec_aso));
|
||||
spin_unlock_bh(&aso->lock);
|
||||
|
||||
@@ -6868,6 +6868,14 @@ static int _mlx5e_probe(struct auxiliary_device *adev)
|
||||
goto err_resume;
|
||||
}
|
||||
|
||||
/* mlx5e_fix_features() returns early when the device is not present
|
||||
* to avoid dereferencing cleared priv during profile changes.
|
||||
* This also causes it to be a no-op during register_netdev(), where
|
||||
* the device is not yet present.
|
||||
* Trigger an additional features update that will actually work.
|
||||
*/
|
||||
mlx5e_update_features(netdev);
|
||||
|
||||
mlx5e_dcbnl_init_app(priv);
|
||||
mlx5_core_uplink_netdev_set(mdev, netdev);
|
||||
mlx5e_params_print_info(mdev, &priv->channels.params);
|
||||
|
||||
@@ -139,7 +139,7 @@ void fbnic_up(struct fbnic_net *fbn)
|
||||
|
||||
/* Enable Tx/Rx processing */
|
||||
fbnic_napi_enable(fbn);
|
||||
netif_tx_start_all_queues(fbn->netdev);
|
||||
netif_tx_wake_all_queues(fbn->netdev);
|
||||
|
||||
fbnic_service_task_start(fbn);
|
||||
|
||||
|
||||
@@ -2065,11 +2065,8 @@ static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
gc->dev = &pdev->dev;
|
||||
xa_init(&gc->irq_contexts);
|
||||
|
||||
if (gc->is_pf)
|
||||
gc->mana_pci_debugfs = debugfs_create_dir("0", mana_debugfs_root);
|
||||
else
|
||||
gc->mana_pci_debugfs = debugfs_create_dir(pci_slot_name(pdev->slot),
|
||||
mana_debugfs_root);
|
||||
gc->mana_pci_debugfs = debugfs_create_dir(pci_name(pdev),
|
||||
mana_debugfs_root);
|
||||
|
||||
err = mana_gd_setup(pdev);
|
||||
if (err)
|
||||
|
||||
@@ -3154,6 +3154,8 @@ static int mana_init_port(struct net_device *ndev)
|
||||
eth_hw_addr_set(ndev, apc->mac_addr);
|
||||
sprintf(vport, "vport%d", port_idx);
|
||||
apc->mana_port_debugfs = debugfs_create_dir(vport, gc->mana_pci_debugfs);
|
||||
debugfs_create_u32("current_speed", 0400, apc->mana_port_debugfs,
|
||||
&apc->speed);
|
||||
return 0;
|
||||
|
||||
reset_apc:
|
||||
@@ -3432,8 +3434,6 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
|
||||
|
||||
netif_carrier_on(ndev);
|
||||
|
||||
debugfs_create_u32("current_speed", 0400, apc->mana_port_debugfs, &apc->speed);
|
||||
|
||||
return 0;
|
||||
|
||||
free_indir:
|
||||
|
||||
@@ -657,7 +657,9 @@ void txgbe_remove_phy(struct txgbe *txgbe)
|
||||
return;
|
||||
case wx_mac_sp:
|
||||
if (txgbe->wx->media_type == wx_media_copper) {
|
||||
rtnl_lock();
|
||||
phylink_disconnect_phy(txgbe->wx->phylink);
|
||||
rtnl_unlock();
|
||||
phylink_destroy(txgbe->wx->phylink);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -391,7 +391,6 @@ static void sixpack_receive_buf(struct tty_struct *tty, const u8 *cp,
|
||||
const u8 *fp, size_t count)
|
||||
{
|
||||
struct sixpack *sp;
|
||||
size_t count1;
|
||||
|
||||
if (!count)
|
||||
return;
|
||||
@@ -401,16 +400,16 @@ static void sixpack_receive_buf(struct tty_struct *tty, const u8 *cp,
|
||||
return;
|
||||
|
||||
/* Read the characters out of the buffer */
|
||||
count1 = count;
|
||||
while (count) {
|
||||
count--;
|
||||
while (count--) {
|
||||
if (fp && *fp++) {
|
||||
if (!test_and_set_bit(SIXPF_ERROR, &sp->flags))
|
||||
sp->dev->stats.rx_errors++;
|
||||
cp++;
|
||||
continue;
|
||||
}
|
||||
sixpack_decode(sp, cp, 1);
|
||||
cp++;
|
||||
}
|
||||
sixpack_decode(sp, cp, count1);
|
||||
|
||||
tty_unthrottle(tty);
|
||||
}
|
||||
|
||||
@@ -187,6 +187,9 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
|
||||
|
||||
len = skb->data[0] + skb->data[1] * 256 - 5;
|
||||
|
||||
if (len < 0 || len > skb->len - 2)
|
||||
goto drop_unlock;
|
||||
|
||||
skb_pull(skb, 2); /* Remove the length bytes */
|
||||
skb_trim(skb, len); /* Set the length of the data */
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user