<!DOCTYPE html>
<!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">
> -----Original Message----- > From: skori@ marvell. com <skori@ marvell. com> > Sent: Tuesday, April 29, 2025 11: 42 PM > To: Thomas Monjalon <thomas@ monjalon. net>; Ferruh Yigit > <ferruh. yigit@ amd. com>; Andrew Rybchenko</div>
<!-- Preheader Text : END -->

<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</div>

<!--[if ((ie)|(mso))]>
  <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 16px 0px 16px 0px; direction: ltr" lang="en"><tr><td>
    <table border="0" cellspacing="0" cellpadding="0" style="padding: 0px 10px 5px 6px; width: 100%; border-radius:4px; border-top:4px solid #8d8c8c;background-color:#D2D0D0;"><tr><td valign="top">
      <table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 4px 8px 4px 8px">
        <tr><td style="color:#000000; font-family: 'Arial', sans-serif; font-weight:bold; font-size:14px; direction: ltr">
          Prioritize security for external emails:
        </td></tr>
        <tr><td style="color:#000000; font-weight:normal; font-family: 'Arial', sans-serif; font-size:12px; direction: ltr">
          Confirm sender and content safety before clicking links or opening attachments
        </td></tr>

      </table>
      <![if ie]><br clear="all"><![endif]>
      <table align="right" border="0" cellspacing="0" cellpadding="0" style="padding: 4px 0px 4px 0px"><tr>
        <td style="direction: ltr">  <a target="_blank" href="https://us-phishalarm-ewt.proofpoint.com/EWT/v1/CRVmXkqW!ui3X2N84rjX7-6H8OTxaz4hFS5GAnsUewThiEWIMl1SktpBqvQds4DSQNygCxIhXG9WO5uU2zEzcJ_jJFn4Uv1NBfVlohJijR41_8bELC66MmBDGhQ3kXkbTvEmYoLdGH0SLgOQ$" style="mso-padding-alt: 7.5px; padding: 7.5px; border-radius: 2px; border: 1.5px solid #666666; "><strong style="font-weight: normal; color: #000000; text-decoration: none; font-family: 'Arial', sans-serif; font-size:14px; line-height: 40px; ">  Report Suspicious  </strong></a>  ‌ </td>
      </tr></table>
    </td></tr></table>
  </td></tr></table>
<![endif]-->

<![if !((ie)|(mso))]>
  <div dir="ltr" lang="en" id="pfptBannerrx63fg0" style="all: revert !important; display:block !important; text-align: left !important; margin:16px 0px 16px 0px !important; padding:8px 16px 8px 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: #D2D0D0 !important; background-color: #D2D0D0; border-top: 4px solid #8d8c8c !important; border-top: 4px solid #8d8c8c;">
    <div id="pfptBannerrx63fg0" style="all: unset !important; float:left !important; display:block !important; margin: 0px 0px 1px 0px !important; max-width: 600px !important;">
      <div id="pfptBannerrx63fg0" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D2D0D0 !important; color:#000000 !important; color:#000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-weight:bold !important; font-weight:bold; font-size:14px !important; line-height:18px !important; line-height:18px">
        Prioritize security for external emails:
      </div>
      <div id="pfptBannerrx63fg0" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D2D0D0 !important; color:#000000 !important; color:#000000; font-weight:normal; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size:12px !important; line-height:18px !important; line-height:18px; margin-top:2px !important;">
Confirm sender and content safety before clicking links or opening attachments
      </div>

    </div>
    <div id="pfptBannerrx63fg0" style="all: unset !important; float: right !important; display: block !important; display: block; margin: 0px 0px 0px 16px !important; text-align: right !important; width: fit-content !important;">
<a id="pfptBannerrx63fg0" href="https://us-phishalarm-ewt.proofpoint.com/EWT/v1/CRVmXkqW!ui3X2N84rjX7-6H8OTxaz4hFS5GAnsUewThiEWIMl1SktpBqvQds4DSQNygCxIhXG9WO5uU2zEzcJ_jJFn4Uv1NBfVlohJijR41_8bELC66MmBDGhQ3kXkbTvEmYoLdGH0SLgOQ$"
    style="all: unset !important; display: inline-block !important; text-decoration: none">
    <div class="pfptPrimaryButtonrx63fg0" style="display: inline-block !important; display: inline-block; visibility: visible !important; opacity: 1 !important; color: #000000 !important; color: #000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size: 14px !important; font-weight: normal !important; text-decoration: none !important; border-radius: 2px !important; padding: 7.5px 16px !important; margin: 3px 0 3px 16px !important; white-space: nowrap !important; width: fit-content !important;
        border: 1px solid #666666">
        Report Suspicious
    </div>
</a>
    </div>
    <div style="clear: both !important; display: block !important; visibility: hidden !important; line-height: 0 !important; font-size: 0.01px !important; height: 0px"> </div>
  </div>
<![endif]>

<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->

<!-- BaNnErBlUrFlE-BoDy-end -->
<html>
<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
  #pfptBannerrx63fg0 { all: revert !important; display: block !important; 
    visibility: visible !important; opacity: 1 !important; 
    background-color: #D2D0D0 !important; 
    max-width: none !important; max-height: none !important }
  .pfptPrimaryButtonrx63fg0:hover, .pfptPrimaryButtonrx63fg0:focus {
    background-color: #afaeae !important; }
  .pfptPrimaryButtonrx63fg0:active {
    background-color: #8d8c8c !important; }
</style>

<!-- BaNnErBlUrFlE-HeAdEr-end -->
</head><body><pre style="font-family: sans-serif; font-size: 100%; white-space: pre-wrap; word-wrap: break-word">

> -----Original Message-----
> From: skori@marvell.com <skori@marvell.com>
> Sent: Tuesday, April 29, 2025 11:42 PM
> To: Thomas Monjalon <thomas@monjalon.net>; Ferruh Yigit
> <ferruh.yigit@amd.com>; Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru>
> Cc: dev@dpdk.org; Sunil Kumar Kori <skori@marvell.com>
> Subject: [EXTERNAL] [PATCH] ethdev: remove callback checks from fast path

> From: Sunil Kumar Kori <skori@ marvell. com> rte_eth_fp_ops contains ops for
> fast path APIs. Each API validates availability of callback and then invoke it.
> Removing these NULL checks instead using dummy callbacks. Signed-off-by:
> Sunil Kumar ZjQcmQRYFpfptBannerStart Prioritize security for external emails:
> Confirm sender and content safety before clicking links or opening attachments
> <https://us-phishalarm-
> ewt.proofpoint.com/EWT/v1/CRVmXkqW!ta3Z1f8UAnVatS-
> duf16Ds5hp4nuuus0UNv0GRLoKGk6KzbJ62cMLHhvd3kJIBAKh3RoWS1_8sxE-
> fhkSRumJQAQ4NQ$>
> Report Suspicious

> ZjQcmQRYFpfptBannerEnd
> From: Sunil Kumar Kori <skori@marvell.com>

> rte_eth_fp_ops contains ops for fast path APIs. Each API validates availability of
> callback and then invoke it.

> Removing these NULL checks instead using dummy callbacks.

> Signed-off-by: Sunil Kumar Kori <skori@marvell.com>


Please check the CI issues.
https://patches.dpdk.org/project/dpdk/patch/20250512150732.65743-2-skori@marvell.com/


> ---
>  lib/ethdev/ethdev_driver.c | 47 ++++++++++++++++++++++
> lib/ethdev/ethdev_driver.h | 82
> ++++++++++++++++++++++++++++++++++++++
>  lib/ethdev/ethdev_pci.h    | 19 +++++++++
>  lib/ethdev/rte_ethdev.h    | 20 +---------
>  4 files changed, 150 insertions(+), 18 deletions(-)

> diff --git a/lib/ethdev/ethdev_driver.c b/lib/ethdev/ethdev_driver.c index
> ec0c1e1176..75073f98cf 100644
> --- a/lib/ethdev/ethdev_driver.c
> +++ b/lib/ethdev/ethdev_driver.c
> @@ -847,6 +847,53 @@ rte_eth_pkt_burst_dummy(void *queue
> __rte_unused,
>    return 0;
>  }

> +RTE_EXPORT_INTERNAL_SYMBOL(rte_eth_tx_pkt_prepare_dummy)
> +uint16_t
> +rte_eth_tx_pkt_prepare_dummy(void *queue __rte_unused,
> +          struct rte_mbuf **pkts __rte_unused,
> +          uint16_t nb_pkts)
> +{
> +  return nb_pkts;
> +}
> +
> +RTE_EXPORT_INTERNAL_SYMBOL(rte_eth_rx_queue_count_dummy)
> +uint32_t
> +rte_eth_rx_queue_count_dummy(void *queue __rte_unused) {
> +  return -ENOTSUP;
> +}
> +
> +RTE_EXPORT_INTERNAL_SYMBOL(rte_eth_tx_queue_count_dummy)
> +int
> +rte_eth_tx_queue_count_dummy(void *queue __rte_unused) {
> +  return -ENOTSUP;
> +}
> +
> +RTE_EXPORT_INTERNAL_SYMBOL(rte_eth_descriptor_status_dummy)
> +int
> +rte_eth_descriptor_status_dummy(void *queue __rte_unused,
> +          uint16_t offset __rte_unused)
> +{
> +  return -ENOTSUP;
> +}
> +
> +RTE_EXPORT_INTERNAL_SYMBOL(rte_eth_recycle_tx_mbufs_reuse_dummy)
> +uint16_t
> +rte_eth_recycle_tx_mbufs_reuse_dummy(void *queue __rte_unused,
> +          struct rte_eth_recycle_rxq_info *recycle_rxq_info
> __rte_unused) {
> +  return 0;
> +}
> +
> +RTE_EXPORT_INTERNAL_SYMBOL(rte_eth_recycle_rx_descriptors_refill_dumm
> y)
> +void
> +rte_eth_recycle_rx_descriptors_refill_dummy(void *queue __rte_unused,
> +          uint16_t nb __rte_unused)
> +{
> +
> +}
> +
>  RTE_EXPORT_INTERNAL_SYMBOL(rte_eth_representor_id_get)
>  int
>  rte_eth_representor_id_get(uint16_t port_id, diff --git
> a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h index
> 2b4d2ae9c3..ec00f16ed3 100644
> --- a/lib/ethdev/ethdev_driver.h
> +++ b/lib/ethdev/ethdev_driver.h
> @@ -1874,6 +1874,88 @@ rte_eth_pkt_burst_dummy(void *queue
> __rte_unused,
>            struct rte_mbuf **pkts __rte_unused,
>            uint16_t nb_pkts __rte_unused);

> +/**
> + * @internal
> + * Dummy DPDK callback for Tx packet prepare.
> + *
> + * @param queue
> + *  Pointer to Tx queue
> + * @param pkts
> + *  Packet array
> + * @param nb_pkts
> + *  Number of packets in packet array
> + */
> +__rte_internal
> +uint16_t
> +rte_eth_tx_pkt_prepare_dummy(void *queue __rte_unused,
> +          struct rte_mbuf **pkts __rte_unused,
> +          uint16_t nb_pkts __rte_unused);
> +
> +/**
> + * @internal
> + * Dummy DPDK callback for Rx queue count.
> + *
> + * @param queue
> + *  Pointer to Rx queue
> + */
> +__rte_internal
> +uint32_t
> +rte_eth_rx_queue_count_dummy(void *queue __rte_unused);
> +
> +/**
> + * @internal
> + * Dummy DPDK callback for Tx queue count.
> + *
> + * @param queue
> + *  Pointer to Tx queue
> + */
> +__rte_internal
> +int
> +rte_eth_tx_queue_count_dummy(void *queue __rte_unused);
> +
> +/**
> + * @internal
> + * Dummy DPDK callback for descriptor status.
> + *
> + * @param queue
> + *  Pointer to Rx/Tx queue
> + * @param offset
> + *  The offset of the descriptor starting from tail (0 is the next
> + *  packet to be received by the driver).
> + */
> +__rte_internal
> +int
> +rte_eth_descriptor_status_dummy(void *queue __rte_unused,
> +          uint16_t offset __rte_unused);
> +
> +/**
> + * @internal
> + * Dummy DPDK callback for recycle Tx mbufs reuse.
> + *
> + * @param queue
> + *  Pointer to Tx queue
> + * @param recycle_rxq_info
> + *  Pointer to recycle Rx queue info
> + */
> +__rte_internal
> +uint16_t
> +rte_eth_recycle_tx_mbufs_reuse_dummy(void *queue __rte_unused,
> +          struct rte_eth_recycle_rxq_info *recycle_rxq_info
> __rte_unused);
> +
> +/**
> + * @internal
> + * Dummy DPDK callback Rx descriptor refill.
> + *
> + * @param queue
> + *  Pointer Rx queue
> + * @param offset
> + *  number of descriptors to refill
> + */
> +__rte_internal
> +void
> +rte_eth_recycle_rx_descriptors_refill_dummy(void *queue __rte_unused,
> +          uint16_t nb __rte_unused);
> +
>  /**
>   * Allocate an unique switch domain identifier.
>   *
> diff --git a/lib/ethdev/ethdev_pci.h b/lib/ethdev/ethdev_pci.h index
> 2229ffa252..1bd49ab822 100644
> --- a/lib/ethdev/ethdev_pci.h
> +++ b/lib/ethdev/ethdev_pci.h
> @@ -16,6 +16,20 @@
>  extern "C" {
>  #endif

> +static inline void
> +rte_eth_set_dummy_fops(struct rte_eth_dev *eth_dev) {
> +  eth_dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
> +  eth_dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
> +  eth_dev->tx_pkt_prepare = rte_eth_tx_pkt_prepare_dummy;
> +  eth_dev->rx_queue_count = rte_eth_rx_queue_count_dummy;
> +  eth_dev->tx_queue_count = rte_eth_tx_queue_count_dummy;
> +  eth_dev->rx_descriptor_status = rte_eth_descriptor_status_dummy;
> +  eth_dev->tx_descriptor_status = rte_eth_descriptor_status_dummy;
> +  eth_dev->recycle_tx_mbufs_reuse =
> rte_eth_recycle_tx_mbufs_reuse_dummy;
> +  eth_dev->recycle_rx_descriptors_refill =
> +rte_eth_recycle_rx_descriptors_refill_dummy;
> +}
> +
>  /**
>   * Copy pci device info to the Ethernet device data.
>   * Shared memory (eth_dev->data) only updated by primary process, so it is
> safe @@ -147,6 +161,11 @@ rte_eth_dev_pci_generic_probe(struct
> rte_pci_device *pci_dev,
>    if (!eth_dev)
>            return -ENOMEM;

> +  /* Update fast path ops with dummy callbacks. Driver will update
> +   * them with required callbacks in the init function.
> +   */
> +  rte_eth_set_dummy_fops(eth_dev);
> +
>    ret = dev_init(eth_dev);
>    if (ret)
>            rte_eth_dev_release_port(eth_dev);
> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index
> ea7f8c4a1a..aa67b69134 100644
> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> @@ -6399,8 +6399,6 @@ rte_eth_rx_queue_count(uint16_t port_id, uint16_t
> queue_id)
>            return -EINVAL;
>  #endif

> -  if (p->rx_queue_count == NULL)
> -          return -ENOTSUP;
>    return (int)p->rx_queue_count(qd);
>  }

> @@ -6471,8 +6469,6 @@ rte_eth_rx_descriptor_status(uint16_t port_id,
> uint16_t queue_id,
>    if (qd == NULL)
>            return -ENODEV;
>  #endif
> -  if (p->rx_descriptor_status == NULL)
> -          return -ENOTSUP;
>    return p->rx_descriptor_status(qd, offset);  }

> @@ -6542,8 +6538,6 @@ static inline int
> rte_eth_tx_descriptor_status(uint16_t port_id,
>    if (qd == NULL)
>            return -ENODEV;
>  #endif
> -  if (p->tx_descriptor_status == NULL)
> -          return -ENOTSUP;
>    return p->tx_descriptor_status(qd, offset);  }

> @@ -6786,9 +6780,6 @@ rte_eth_tx_prepare(uint16_t port_id, uint16_t
> queue_id,
>    }
>  #endif

> -  if (!p->tx_pkt_prepare)
> -          return nb_pkts;
> -
>    return p->tx_pkt_prepare(qd, tx_pkts, nb_pkts);  }

> @@ -6985,8 +6976,6 @@ rte_eth_recycle_mbufs(uint16_t rx_port_id,
> uint16_t rx_queue_id,
>            return 0;
>    }
>  #endif
> -  if (p1->recycle_tx_mbufs_reuse == NULL)
> -          return 0;

>  #ifdef RTE_ETHDEV_DEBUG_RX
>    if (rx_port_id >= RTE_MAX_ETHPORTS ||
> @@ -7010,8 +6999,6 @@ rte_eth_recycle_mbufs(uint16_t rx_port_id,
> uint16_t rx_queue_id,
>            return 0;
>    }
>  #endif
> -  if (p2->recycle_rx_descriptors_refill == NULL)
> -          return 0;

>    /* Copy used *rte_mbuf* buffer pointers from Tx mbuf ring
>     * into Rx mbuf ring.
> @@ -7131,14 +7118,11 @@ rte_eth_tx_queue_count(uint16_t port_id,
> uint16_t queue_id)
>            goto out;
>    }
>  #endif
> -  if (fops->tx_queue_count == NULL) {
> -          rc = -ENOTSUP;
> -          goto out;
> -  }
> -
>    rc = fops->tx_queue_count(qd);

> +#ifdef RTE_ETHDEV_DEBUG_TX
>  out:
> +#endif
>    rte_eth_trace_tx_queue_count(port_id, queue_id, rc);
>    return rc;
>  }
> --
> 2.43.0

</pre></body></html>