* [PATCH v1 0/2] net/octeon_ep: support device close and port kind
@ 2023-02-21 14:36 Sathesh Edara
2023-02-21 14:36 ` [PATCH v1 1/2] net/octeon_ep: support device close Sathesh Edara
2023-02-21 14:36 ` [PATCH v1 2/2] net/octeon_ep: support port kind Sathesh Edara
0 siblings, 2 replies; 4+ messages in thread
From: Sathesh Edara @ 2023-02-21 14:36 UTC (permalink / raw)
To: sburla, jerinj, sedara; +Cc: dev
This patch set adds device close functionality
and 2nd patch adds port kind functionality.
Sathesh Edara (2):
net/octeon_ep: support device close
net/octeon_ep: support port kind
drivers/net/octeon_ep/otx_ep_common.h | 1 +
drivers/net/octeon_ep/otx_ep_ethdev.c | 65 +++++++++++++--------------
drivers/net/octeon_ep/otx_ep_rxtx.c | 16 +++----
3 files changed, 39 insertions(+), 43 deletions(-)
--
2.31.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v1 1/2] net/octeon_ep: support device close
2023-02-21 14:36 [PATCH v1 0/2] net/octeon_ep: support device close and port kind Sathesh Edara
@ 2023-02-21 14:36 ` Sathesh Edara
2023-02-21 14:36 ` [PATCH v1 2/2] net/octeon_ep: support port kind Sathesh Edara
1 sibling, 0 replies; 4+ messages in thread
From: Sathesh Edara @ 2023-02-21 14:36 UTC (permalink / raw)
To: sburla, jerinj, sedara, Radha Mohan Chintakuntla, Veerasenareddy Burru
Cc: dev
Added dev close functionality in the ethdev ops
and moves input and output queue deletion
functionality into it from otx_epdev_exit()
routine.
Signed-off-by: Sathesh Edara <sedara@marvell.com>
---
drivers/net/octeon_ep/otx_ep_ethdev.c | 63 ++++++++++++---------------
1 file changed, 29 insertions(+), 34 deletions(-)
diff --git a/drivers/net/octeon_ep/otx_ep_ethdev.c b/drivers/net/octeon_ep/otx_ep_ethdev.c
index c8f4abe4ca..0930efedce 100644
--- a/drivers/net/octeon_ep/otx_ep_ethdev.c
+++ b/drivers/net/octeon_ep/otx_ep_ethdev.c
@@ -395,6 +395,34 @@ otx_ep_dev_stats_get(struct rte_eth_dev *eth_dev,
return 0;
}
+static int
+otx_ep_dev_close(struct rte_eth_dev *eth_dev)
+{
+ struct otx_ep_device *otx_epvf = OTX_EP_DEV(eth_dev);
+ uint32_t num_queues, q_no;
+
+ otx_epvf->fn_list.disable_io_queues(otx_epvf);
+ num_queues = otx_epvf->nb_rx_queues;
+ for (q_no = 0; q_no < num_queues; q_no++) {
+ if (otx_ep_delete_oqs(otx_epvf, q_no)) {
+ otx_ep_err("Failed to delete OQ:%d\n", q_no);
+ return -EINVAL;
+ }
+ }
+ otx_ep_dbg("Num OQs:%d freed\n", otx_epvf->nb_rx_queues);
+
+ num_queues = otx_epvf->nb_tx_queues;
+ for (q_no = 0; q_no < num_queues; q_no++) {
+ if (otx_ep_delete_iqs(otx_epvf, q_no)) {
+ otx_ep_err("Failed to delete IQ:%d\n", q_no);
+ return -EINVAL;
+ }
+ }
+ otx_ep_dbg("Num IQs:%d freed\n", otx_epvf->nb_tx_queues);
+
+ return 0;
+}
+
static int
otx_ep_dev_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete)
{
@@ -424,47 +452,14 @@ static const struct eth_dev_ops otx_ep_eth_dev_ops = {
.stats_get = otx_ep_dev_stats_get,
.stats_reset = otx_ep_dev_stats_reset,
.link_update = otx_ep_dev_link_update,
+ .dev_close = otx_ep_dev_close,
};
-static int
-otx_epdev_exit(struct rte_eth_dev *eth_dev)
-{
- struct otx_ep_device *otx_epvf;
- uint32_t num_queues, q;
-
- otx_ep_info("%s:\n", __func__);
-
- otx_epvf = OTX_EP_DEV(eth_dev);
-
- otx_epvf->fn_list.disable_io_queues(otx_epvf);
-
- num_queues = otx_epvf->nb_rx_queues;
- for (q = 0; q < num_queues; q++) {
- if (otx_ep_delete_oqs(otx_epvf, q)) {
- otx_ep_err("Failed to delete OQ:%d\n", q);
- return -EINVAL;
- }
- }
- otx_ep_info("Num OQs:%d freed\n", otx_epvf->nb_rx_queues);
-
- num_queues = otx_epvf->nb_tx_queues;
- for (q = 0; q < num_queues; q++) {
- if (otx_ep_delete_iqs(otx_epvf, q)) {
- otx_ep_err("Failed to delete IQ:%d\n", q);
- return -EINVAL;
- }
- }
- otx_ep_dbg("Num IQs:%d freed\n", otx_epvf->nb_tx_queues);
-
- return 0;
-}
-
static int
otx_ep_eth_dev_uninit(struct rte_eth_dev *eth_dev)
{
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
- otx_epdev_exit(eth_dev);
eth_dev->dev_ops = NULL;
eth_dev->rx_pkt_burst = NULL;
--
2.31.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v1 2/2] net/octeon_ep: support port kind
2023-02-21 14:36 [PATCH v1 0/2] net/octeon_ep: support device close and port kind Sathesh Edara
2023-02-21 14:36 ` [PATCH v1 1/2] net/octeon_ep: support device close Sathesh Edara
@ 2023-02-21 14:36 ` Sathesh Edara
2023-03-02 17:05 ` Jerin Jacob
1 sibling, 1 reply; 4+ messages in thread
From: Sathesh Edara @ 2023-02-21 14:36 UTC (permalink / raw)
To: sburla, jerinj, sedara, Radha Mohan Chintakuntla, Veerasenareddy Burru
Cc: dev
Added port kind functionality.
Signed-off-by: Sathesh Edara <sedara@marvell.com>
---
drivers/net/octeon_ep/otx_ep_common.h | 1 +
drivers/net/octeon_ep/otx_ep_ethdev.c | 2 +-
drivers/net/octeon_ep/otx_ep_rxtx.c | 16 ++++++++--------
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/net/octeon_ep/otx_ep_common.h b/drivers/net/octeon_ep/otx_ep_common.h
index 7eb50af75a..e4c92270d4 100644
--- a/drivers/net/octeon_ep/otx_ep_common.h
+++ b/drivers/net/octeon_ep/otx_ep_common.h
@@ -32,6 +32,7 @@
#define OTX_EP_PCI_RING_ALIGN 65536
#define SDP_PKIND 40
#define SDP_OTX2_PKIND 57
+#define SDP_OTX2_PKIND_FS0 0
#define ORDERED_TAG 0
#define ATOMIC_TAG 1
diff --git a/drivers/net/octeon_ep/otx_ep_ethdev.c b/drivers/net/octeon_ep/otx_ep_ethdev.c
index 0930efedce..f43db1e398 100644
--- a/drivers/net/octeon_ep/otx_ep_ethdev.c
+++ b/drivers/net/octeon_ep/otx_ep_ethdev.c
@@ -495,7 +495,7 @@ otx_ep_eth_dev_init(struct rte_eth_dev *eth_dev)
otx_epdev_init(otx_epvf);
if (pdev->id.device_id == PCI_DEVID_CN9K_EP_NET_VF)
- otx_epvf->pkind = SDP_OTX2_PKIND;
+ otx_epvf->pkind = SDP_OTX2_PKIND_FS0;
else
otx_epvf->pkind = SDP_PKIND;
otx_ep_info("using pkind %d\n", otx_epvf->pkind);
diff --git a/drivers/net/octeon_ep/otx_ep_rxtx.c b/drivers/net/octeon_ep/otx_ep_rxtx.c
index 59df6ad857..6912ca2401 100644
--- a/drivers/net/octeon_ep/otx_ep_rxtx.c
+++ b/drivers/net/octeon_ep/otx_ep_rxtx.c
@@ -17,7 +17,8 @@
#include "otx_ep_rxtx.h"
/* SDP_LENGTH_S specifies packet length and is of 8-byte size */
-#define INFO_SIZE 8
+#define OTX_EP_INFO_SIZE 8
+#define OTX_EP_FSZ_FS0 0
#define DROQ_REFILL_THRESHOLD 16
static void
@@ -678,7 +679,7 @@ otx2_ep_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
iqcmd2.irh.u64 = 0;
/* ih invars */
- iqcmd2.ih.s.fsz = OTX2_EP_FSZ;
+ iqcmd2.ih.s.fsz = OTX_EP_FSZ_FS0;
iqcmd2.ih.s.pkind = otx_ep->pkind; /* The SDK decided PKIND value */
/* irh invars */
iqcmd2.irh.s.opcode = OTX_EP_NW_PKT_OP;
@@ -875,12 +876,11 @@ otx_ep_droq_read_packet(struct otx_ep_device *otx_ep,
info->length = rte_bswap64(info->length);
/* Deduce the actual data size */
- total_pkt_len = info->length + INFO_SIZE;
+ total_pkt_len = info->length + OTX_EP_INFO_SIZE;
if (total_pkt_len <= droq->buffer_size) {
- info->length -= OTX_EP_RH_SIZE;
droq_pkt = droq->recv_buf_list[droq->read_idx];
if (likely(droq_pkt != NULL)) {
- droq_pkt->data_off += OTX_EP_DROQ_INFO_SIZE;
+ droq_pkt->data_off += OTX_EP_INFO_SIZE;
/* otx_ep_dbg("OQ: pkt_len[%ld], buffer_size %d\n",
* (long)info->length, droq->buffer_size);
*/
@@ -917,11 +917,11 @@ otx_ep_droq_read_packet(struct otx_ep_device *otx_ep,
droq_pkt->port = otx_ep->port_id;
if (!pkt_len) {
droq_pkt->data_off +=
- OTX_EP_DROQ_INFO_SIZE;
+ OTX_EP_INFO_SIZE;
droq_pkt->pkt_len =
- cpy_len - OTX_EP_DROQ_INFO_SIZE;
+ cpy_len - OTX_EP_INFO_SIZE;
droq_pkt->data_len =
- cpy_len - OTX_EP_DROQ_INFO_SIZE;
+ cpy_len - OTX_EP_INFO_SIZE;
} else {
droq_pkt->pkt_len = cpy_len;
droq_pkt->data_len = cpy_len;
--
2.31.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1 2/2] net/octeon_ep: support port kind
2023-02-21 14:36 ` [PATCH v1 2/2] net/octeon_ep: support port kind Sathesh Edara
@ 2023-03-02 17:05 ` Jerin Jacob
0 siblings, 0 replies; 4+ messages in thread
From: Jerin Jacob @ 2023-03-02 17:05 UTC (permalink / raw)
To: Sathesh Edara
Cc: sburla, jerinj, Radha Mohan Chintakuntla, Veerasenareddy Burru, dev
On Tue, Feb 21, 2023 at 8:07 PM Sathesh Edara <sedara@marvell.com> wrote:
>
> Added port kind functionality.
>
> Signed-off-by: Sathesh Edara <sedara@marvell.com>
Series applied to dpdk-next-net-mrvl/for-next-net. Thanks
> ---
> drivers/net/octeon_ep/otx_ep_common.h | 1 +
> drivers/net/octeon_ep/otx_ep_ethdev.c | 2 +-
> drivers/net/octeon_ep/otx_ep_rxtx.c | 16 ++++++++--------
> 3 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/octeon_ep/otx_ep_common.h b/drivers/net/octeon_ep/otx_ep_common.h
> index 7eb50af75a..e4c92270d4 100644
> --- a/drivers/net/octeon_ep/otx_ep_common.h
> +++ b/drivers/net/octeon_ep/otx_ep_common.h
> @@ -32,6 +32,7 @@
> #define OTX_EP_PCI_RING_ALIGN 65536
> #define SDP_PKIND 40
> #define SDP_OTX2_PKIND 57
> +#define SDP_OTX2_PKIND_FS0 0
>
> #define ORDERED_TAG 0
> #define ATOMIC_TAG 1
> diff --git a/drivers/net/octeon_ep/otx_ep_ethdev.c b/drivers/net/octeon_ep/otx_ep_ethdev.c
> index 0930efedce..f43db1e398 100644
> --- a/drivers/net/octeon_ep/otx_ep_ethdev.c
> +++ b/drivers/net/octeon_ep/otx_ep_ethdev.c
> @@ -495,7 +495,7 @@ otx_ep_eth_dev_init(struct rte_eth_dev *eth_dev)
>
> otx_epdev_init(otx_epvf);
> if (pdev->id.device_id == PCI_DEVID_CN9K_EP_NET_VF)
> - otx_epvf->pkind = SDP_OTX2_PKIND;
> + otx_epvf->pkind = SDP_OTX2_PKIND_FS0;
> else
> otx_epvf->pkind = SDP_PKIND;
> otx_ep_info("using pkind %d\n", otx_epvf->pkind);
> diff --git a/drivers/net/octeon_ep/otx_ep_rxtx.c b/drivers/net/octeon_ep/otx_ep_rxtx.c
> index 59df6ad857..6912ca2401 100644
> --- a/drivers/net/octeon_ep/otx_ep_rxtx.c
> +++ b/drivers/net/octeon_ep/otx_ep_rxtx.c
> @@ -17,7 +17,8 @@
> #include "otx_ep_rxtx.h"
>
> /* SDP_LENGTH_S specifies packet length and is of 8-byte size */
> -#define INFO_SIZE 8
> +#define OTX_EP_INFO_SIZE 8
> +#define OTX_EP_FSZ_FS0 0
> #define DROQ_REFILL_THRESHOLD 16
>
> static void
> @@ -678,7 +679,7 @@ otx2_ep_xmit_pkts(void *tx_queue, struct rte_mbuf **pkts, uint16_t nb_pkts)
> iqcmd2.irh.u64 = 0;
>
> /* ih invars */
> - iqcmd2.ih.s.fsz = OTX2_EP_FSZ;
> + iqcmd2.ih.s.fsz = OTX_EP_FSZ_FS0;
> iqcmd2.ih.s.pkind = otx_ep->pkind; /* The SDK decided PKIND value */
> /* irh invars */
> iqcmd2.irh.s.opcode = OTX_EP_NW_PKT_OP;
> @@ -875,12 +876,11 @@ otx_ep_droq_read_packet(struct otx_ep_device *otx_ep,
>
> info->length = rte_bswap64(info->length);
> /* Deduce the actual data size */
> - total_pkt_len = info->length + INFO_SIZE;
> + total_pkt_len = info->length + OTX_EP_INFO_SIZE;
> if (total_pkt_len <= droq->buffer_size) {
> - info->length -= OTX_EP_RH_SIZE;
> droq_pkt = droq->recv_buf_list[droq->read_idx];
> if (likely(droq_pkt != NULL)) {
> - droq_pkt->data_off += OTX_EP_DROQ_INFO_SIZE;
> + droq_pkt->data_off += OTX_EP_INFO_SIZE;
> /* otx_ep_dbg("OQ: pkt_len[%ld], buffer_size %d\n",
> * (long)info->length, droq->buffer_size);
> */
> @@ -917,11 +917,11 @@ otx_ep_droq_read_packet(struct otx_ep_device *otx_ep,
> droq_pkt->port = otx_ep->port_id;
> if (!pkt_len) {
> droq_pkt->data_off +=
> - OTX_EP_DROQ_INFO_SIZE;
> + OTX_EP_INFO_SIZE;
> droq_pkt->pkt_len =
> - cpy_len - OTX_EP_DROQ_INFO_SIZE;
> + cpy_len - OTX_EP_INFO_SIZE;
> droq_pkt->data_len =
> - cpy_len - OTX_EP_DROQ_INFO_SIZE;
> + cpy_len - OTX_EP_INFO_SIZE;
> } else {
> droq_pkt->pkt_len = cpy_len;
> droq_pkt->data_len = cpy_len;
> --
> 2.31.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-03-02 17:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-21 14:36 [PATCH v1 0/2] net/octeon_ep: support device close and port kind Sathesh Edara
2023-02-21 14:36 ` [PATCH v1 1/2] net/octeon_ep: support device close Sathesh Edara
2023-02-21 14:36 ` [PATCH v1 2/2] net/octeon_ep: support port kind Sathesh Edara
2023-03-02 17:05 ` Jerin Jacob
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).