|
|
@@ -26,8 +26,6 @@ Signed-off-by: Suruchi Agarwal <[email protected]>
|
|
|
create mode 100644 drivers/net/ethernet/qualcomm/ppe/edma_tx.c
|
|
|
create mode 100644 drivers/net/ethernet/qualcomm/ppe/edma_tx.h
|
|
|
|
|
|
-diff --git a/drivers/net/ethernet/qualcomm/ppe/Makefile b/drivers/net/ethernet/qualcomm/ppe/Makefile
|
|
|
-index 3fd607ce42de..b358bfd781fb 100644
|
|
|
--- a/drivers/net/ethernet/qualcomm/ppe/Makefile
|
|
|
+++ b/drivers/net/ethernet/qualcomm/ppe/Makefile
|
|
|
@@ -7,4 +7,4 @@ obj-$(CONFIG_QCOM_PPE) += qcom-ppe.o
|
|
|
@@ -37,8 +35,6 @@ index 3fd607ce42de..b358bfd781fb 100644
|
|
|
-qcom-ppe-objs += edma.o edma_cfg_rx.o edma_port.o edma_rx.o
|
|
|
\ No newline at end of file
|
|
|
+qcom-ppe-objs += edma.o edma_cfg_rx.o edma_cfg_tx.o edma_port.o edma_rx.o edma_tx.o
|
|
|
-diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.c b/drivers/net/ethernet/qualcomm/ppe/edma.c
|
|
|
-index 134f6b95c294..739fcfbde0f9 100644
|
|
|
--- a/drivers/net/ethernet/qualcomm/ppe/edma.c
|
|
|
+++ b/drivers/net/ethernet/qualcomm/ppe/edma.c
|
|
|
@@ -18,6 +18,7 @@
|
|
|
@@ -57,7 +53,7 @@ index 134f6b95c294..739fcfbde0f9 100644
|
|
|
static char **edma_rxdesc_irq_name;
|
|
|
|
|
|
/* Module params. */
|
|
|
-@@ -192,22 +194,59 @@ static int edma_configure_ucast_prio_map_tbl(void)
|
|
|
+@@ -192,22 +194,59 @@ static int edma_configure_ucast_prio_map
|
|
|
static int edma_irq_register(void)
|
|
|
{
|
|
|
struct edma_hw_info *hw_info = edma_ctx->hw_info;
|
|
|
@@ -192,7 +188,7 @@ index 134f6b95c294..739fcfbde0f9 100644
|
|
|
|
|
|
ret = edma_cfg_rx_rings();
|
|
|
if (ret) {
|
|
|
-@@ -520,6 +586,7 @@ static int edma_hw_configure(void)
|
|
|
+@@ -520,6 +586,7 @@ configure_ucast_prio_map_tbl_failed:
|
|
|
edma_cfg_rx_napi_delete();
|
|
|
edma_cfg_rx_rings_disable();
|
|
|
edma_cfg_rx_rings_failed:
|
|
|
@@ -200,7 +196,7 @@ index 134f6b95c294..739fcfbde0f9 100644
|
|
|
edma_cfg_rx_rings_cleanup();
|
|
|
edma_alloc_rings_failed:
|
|
|
free_netdev(edma_ctx->dummy_dev);
|
|
|
-@@ -538,13 +605,27 @@ static int edma_hw_configure(void)
|
|
|
+@@ -538,13 +605,27 @@ dummy_dev_alloc_failed:
|
|
|
void edma_destroy(struct ppe_device *ppe_dev)
|
|
|
{
|
|
|
struct edma_hw_info *hw_info = edma_ctx->hw_info;
|
|
|
@@ -229,7 +225,7 @@ index 134f6b95c294..739fcfbde0f9 100644
|
|
|
for (i = 0; i < rx->num_rings; i++) {
|
|
|
synchronize_irq(edma_ctx->intr_info.intr_rx[i]);
|
|
|
free_irq(edma_ctx->intr_info.intr_rx[i],
|
|
|
-@@ -560,6 +641,7 @@ void edma_destroy(struct ppe_device *ppe_dev)
|
|
|
+@@ -560,6 +641,7 @@ void edma_destroy(struct ppe_device *ppe
|
|
|
edma_cfg_rx_napi_delete();
|
|
|
edma_cfg_rx_rings_disable();
|
|
|
edma_cfg_rx_rings_cleanup();
|
|
|
@@ -237,7 +233,7 @@ index 134f6b95c294..739fcfbde0f9 100644
|
|
|
|
|
|
free_netdev(edma_ctx->dummy_dev);
|
|
|
kfree(edma_ctx->netdev_arr);
|
|
|
-@@ -585,6 +667,7 @@ int edma_setup(struct ppe_device *ppe_dev)
|
|
|
+@@ -585,6 +667,7 @@ int edma_setup(struct ppe_device *ppe_de
|
|
|
edma_ctx->hw_info = &ipq9574_hw_info;
|
|
|
edma_ctx->ppe_dev = ppe_dev;
|
|
|
edma_ctx->rx_buf_size = rx_buff_size;
|
|
|
@@ -245,8 +241,6 @@ index 134f6b95c294..739fcfbde0f9 100644
|
|
|
|
|
|
/* Configure the EDMA common clocks. */
|
|
|
ret = edma_clock_init();
|
|
|
-diff --git a/drivers/net/ethernet/qualcomm/ppe/edma.h b/drivers/net/ethernet/qualcomm/ppe/edma.h
|
|
|
-index 778df7997d9f..fb8ccbfbaf41 100644
|
|
|
--- a/drivers/net/ethernet/qualcomm/ppe/edma.h
|
|
|
+++ b/drivers/net/ethernet/qualcomm/ppe/edma.h
|
|
|
@@ -7,6 +7,7 @@
|
|
|
@@ -281,9 +275,6 @@ index 778df7997d9f..fb8ccbfbaf41 100644
|
|
|
};
|
|
|
|
|
|
/* Global EDMA context */
|
|
|
-diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.c b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.c
|
|
|
-new file mode 100644
|
|
|
-index 000000000000..f704c654b2cd
|
|
|
--- /dev/null
|
|
|
+++ b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.c
|
|
|
@@ -0,0 +1,648 @@
|
|
|
@@ -935,9 +926,6 @@ index 000000000000..f704c654b2cd
|
|
|
+
|
|
|
+ netdev_dbg(netdev, "Tx NAPI budget: %d\n", hw_info->napi_budget_tx);
|
|
|
+}
|
|
|
-diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.h b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.h
|
|
|
-new file mode 100644
|
|
|
-index 000000000000..4840c601fc86
|
|
|
--- /dev/null
|
|
|
+++ b/drivers/net/ethernet/qualcomm/ppe/edma_cfg_tx.h
|
|
|
@@ -0,0 +1,28 @@
|
|
|
@@ -969,8 +957,6 @@ index 000000000000..4840c601fc86
|
|
|
+void edma_cfg_tx_rings_disable(u32 port_id);
|
|
|
+void edma_cfg_tx_fill_per_port_tx_map(struct net_device *netdev, u32 macid);
|
|
|
+#endif
|
|
|
-diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_port.c b/drivers/net/ethernet/qualcomm/ppe/edma_port.c
|
|
|
-index bbb5823408fd..afa2b6479822 100644
|
|
|
--- a/drivers/net/ethernet/qualcomm/ppe/edma_port.c
|
|
|
+++ b/drivers/net/ethernet/qualcomm/ppe/edma_port.c
|
|
|
@@ -13,6 +13,7 @@
|
|
|
@@ -981,7 +967,7 @@ index bbb5823408fd..afa2b6479822 100644
|
|
|
#include "edma_port.h"
|
|
|
#include "ppe_regs.h"
|
|
|
|
|
|
-@@ -35,6 +36,15 @@ static int edma_port_stats_alloc(struct net_device *netdev)
|
|
|
+@@ -35,6 +36,15 @@ static int edma_port_stats_alloc(struct
|
|
|
return -ENOMEM;
|
|
|
}
|
|
|
|
|
|
@@ -997,7 +983,7 @@ index bbb5823408fd..afa2b6479822 100644
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-@@ -43,6 +53,28 @@ static void edma_port_stats_free(struct net_device *netdev)
|
|
|
+@@ -43,6 +53,28 @@ static void edma_port_stats_free(struct
|
|
|
struct edma_port_priv *port_priv = (struct edma_port_priv *)netdev_priv(netdev);
|
|
|
|
|
|
free_percpu(port_priv->pcpu_stats.rx_stats);
|
|
|
@@ -1026,7 +1012,7 @@ index bbb5823408fd..afa2b6479822 100644
|
|
|
}
|
|
|
|
|
|
static u16 __maybe_unused edma_port_select_queue(__maybe_unused struct net_device *netdev,
|
|
|
-@@ -60,6 +92,7 @@ static int edma_port_open(struct net_device *netdev)
|
|
|
+@@ -60,6 +92,7 @@ static int edma_port_open(struct net_dev
|
|
|
{
|
|
|
struct edma_port_priv *port_priv = (struct edma_port_priv *)netdev_priv(netdev);
|
|
|
struct ppe_port *ppe_port;
|
|
|
@@ -1034,7 +1020,7 @@ index bbb5823408fd..afa2b6479822 100644
|
|
|
|
|
|
if (!port_priv)
|
|
|
return -EINVAL;
|
|
|
-@@ -74,10 +107,14 @@ static int edma_port_open(struct net_device *netdev)
|
|
|
+@@ -74,10 +107,14 @@ static int edma_port_open(struct net_dev
|
|
|
netdev->wanted_features |= EDMA_NETDEV_FEATURES;
|
|
|
|
|
|
ppe_port = port_priv->ppe_port;
|
|
|
@@ -1049,7 +1035,7 @@ index bbb5823408fd..afa2b6479822 100644
|
|
|
netif_start_queue(netdev);
|
|
|
|
|
|
return 0;
|
|
|
-@@ -87,13 +124,21 @@ static int edma_port_close(struct net_device *netdev)
|
|
|
+@@ -87,13 +124,21 @@ static int edma_port_close(struct net_de
|
|
|
{
|
|
|
struct edma_port_priv *port_priv = (struct edma_port_priv *)netdev_priv(netdev);
|
|
|
struct ppe_port *ppe_port;
|
|
|
@@ -1071,7 +1057,7 @@ index bbb5823408fd..afa2b6479822 100644
|
|
|
|
|
|
/* Phylink close. */
|
|
|
if (ppe_port->phylink)
|
|
|
-@@ -137,6 +182,92 @@ static netdev_features_t edma_port_feature_check(__maybe_unused struct sk_buff *
|
|
|
+@@ -137,6 +182,92 @@ static netdev_features_t edma_port_featu
|
|
|
return features;
|
|
|
}
|
|
|
|
|
|
@@ -1164,7 +1150,7 @@ index bbb5823408fd..afa2b6479822 100644
|
|
|
static void edma_port_get_stats64(struct net_device *netdev,
|
|
|
struct rtnl_link_stats64 *stats)
|
|
|
{
|
|
|
-@@ -179,6 +310,7 @@ static int edma_port_set_mac_address(struct net_device *netdev, void *macaddr)
|
|
|
+@@ -179,6 +310,7 @@ static int edma_port_set_mac_address(str
|
|
|
static const struct net_device_ops edma_port_netdev_ops = {
|
|
|
.ndo_open = edma_port_open,
|
|
|
.ndo_stop = edma_port_close,
|
|
|
@@ -1172,7 +1158,7 @@ index bbb5823408fd..afa2b6479822 100644
|
|
|
.ndo_get_stats64 = edma_port_get_stats64,
|
|
|
.ndo_set_mac_address = edma_port_set_mac_address,
|
|
|
.ndo_validate_addr = eth_validate_addr,
|
|
|
-@@ -199,6 +331,7 @@ void edma_port_destroy(struct ppe_port *port)
|
|
|
+@@ -199,6 +331,7 @@ void edma_port_destroy(struct ppe_port *
|
|
|
int port_id = port->port_id;
|
|
|
struct net_device *netdev = edma_ctx->netdev_arr[port_id - 1];
|
|
|
|
|
|
@@ -1180,7 +1166,7 @@ index bbb5823408fd..afa2b6479822 100644
|
|
|
edma_port_stats_free(netdev);
|
|
|
unregister_netdev(netdev);
|
|
|
free_netdev(netdev);
|
|
|
-@@ -276,6 +409,8 @@ int edma_port_setup(struct ppe_port *port)
|
|
|
+@@ -276,6 +409,8 @@ int edma_port_setup(struct ppe_port *por
|
|
|
*/
|
|
|
edma_ctx->netdev_arr[port_id - 1] = netdev;
|
|
|
|
|
|
@@ -1189,7 +1175,7 @@ index bbb5823408fd..afa2b6479822 100644
|
|
|
/* Setup phylink. */
|
|
|
ret = ppe_port_phylink_setup(port, netdev);
|
|
|
if (ret) {
|
|
|
-@@ -298,6 +433,7 @@ int edma_port_setup(struct ppe_port *port)
|
|
|
+@@ -298,6 +433,7 @@ int edma_port_setup(struct ppe_port *por
|
|
|
register_netdev_fail:
|
|
|
ppe_port_phylink_destroy(port);
|
|
|
port_phylink_setup_fail:
|
|
|
@@ -1197,8 +1183,6 @@ index bbb5823408fd..afa2b6479822 100644
|
|
|
edma_ctx->netdev_arr[port_id - 1] = NULL;
|
|
|
edma_port_stats_free(netdev);
|
|
|
stats_alloc_fail:
|
|
|
-diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_port.h b/drivers/net/ethernet/qualcomm/ppe/edma_port.h
|
|
|
-index 75f544a4f324..b67eddabd41c 100644
|
|
|
--- a/drivers/net/ethernet/qualcomm/ppe/edma_port.h
|
|
|
+++ b/drivers/net/ethernet/qualcomm/ppe/edma_port.h
|
|
|
@@ -7,6 +7,8 @@
|
|
|
@@ -1210,11 +1194,10 @@ index 75f544a4f324..b67eddabd41c 100644
|
|
|
#define EDMA_NETDEV_FEATURES (NETIF_F_FRAGLIST \
|
|
|
| NETIF_F_SG \
|
|
|
| NETIF_F_RXCSUM \
|
|
|
-@@ -34,12 +36,44 @@ struct edma_port_rx_stats {
|
|
|
- struct u64_stats_sync syncp;
|
|
|
+@@ -35,11 +37,43 @@ struct edma_port_rx_stats {
|
|
|
};
|
|
|
|
|
|
-+/**
|
|
|
+ /**
|
|
|
+ * struct edma_port_tx_stats - EDMA TX port per CPU stats for the port.
|
|
|
+ * @tx_pkts: Number of Tx packets
|
|
|
+ * @tx_bytes: Number of Tx bytes
|
|
|
@@ -1244,7 +1227,7 @@ index 75f544a4f324..b67eddabd41c 100644
|
|
|
+ struct u64_stats_sync syncp;
|
|
|
+};
|
|
|
+
|
|
|
- /**
|
|
|
++/**
|
|
|
* struct edma_port_pcpu_stats - EDMA per cpu stats data structure for the port.
|
|
|
* @rx_stats: Per CPU Rx statistics
|
|
|
+ * @tx_stats: Per CPU Tx statistics
|
|
|
@@ -1263,9 +1246,6 @@ index 75f544a4f324..b67eddabd41c 100644
|
|
|
unsigned long flags;
|
|
|
};
|
|
|
|
|
|
-diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_tx.c b/drivers/net/ethernet/qualcomm/ppe/edma_tx.c
|
|
|
-new file mode 100644
|
|
|
-index 000000000000..47876c142df5
|
|
|
--- /dev/null
|
|
|
+++ b/drivers/net/ethernet/qualcomm/ppe/edma_tx.c
|
|
|
@@ -0,0 +1,808 @@
|
|
|
@@ -2077,9 +2057,6 @@ index 000000000000..47876c142df5
|
|
|
+
|
|
|
+ return EDMA_TX_OK;
|
|
|
+}
|
|
|
-diff --git a/drivers/net/ethernet/qualcomm/ppe/edma_tx.h b/drivers/net/ethernet/qualcomm/ppe/edma_tx.h
|
|
|
-new file mode 100644
|
|
|
-index 000000000000..c09a4e0f6a42
|
|
|
--- /dev/null
|
|
|
+++ b/drivers/net/ethernet/qualcomm/ppe/edma_tx.h
|
|
|
@@ -0,0 +1,302 @@
|
|
|
@@ -2385,6 +2362,3 @@ index 000000000000..c09a4e0f6a42
|
|
|
+ struct net_device *netdev, struct sk_buff **segs);
|
|
|
+
|
|
|
+#endif
|
|
|
---
|
|
|
-2.45.2
|
|
|
-
|