[PATCH v1 2/2] net/octeon_ep: support port kind
Jerin Jacob
jerinjacobk at gmail.com
Thu Mar 2 18:05:44 CET 2023
On Tue, Feb 21, 2023 at 8:07 PM Sathesh Edara <sedara at marvell.com> wrote:
>
> Added port kind functionality.
>
> Signed-off-by: Sathesh Edara <sedara at 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
>
More information about the dev
mailing list