On 1/18/2021 9:36 AM, Nalla Pradeep wrote:
Function to deliver packets from DROQ to application is added. It also
fills DROQ with receive buffers timely such that device can fill them
with incoming packets.

Signed-off-by: Nalla Pradeep <pna...@marvell.com>

<...>

@@ -327,7 +333,8 @@ otx_ep_init_droq(struct otx_ep_device *otx_ep, uint32_t 
q_no,
  /* OQ configuration and setup */
  int
  otx_ep_setup_oqs(struct otx_ep_device *otx_ep, int oq_no, int num_descs,
-              int desc_size, struct rte_mempool *mpool, unsigned int socket_id)
+                int desc_size, struct rte_mempool *mpool,
+                unsigned int socket_id)

Again can you please fix these were it is first introduced?

<...>

+/* Check for response arrival from OCTEON TX2
+ * returns number of requests completed
+ */
+uint16_t
+otx_ep_recv_pkts(void *rx_queue,
+                 struct rte_mbuf **rx_pkts,
+                 uint16_t budget)
+{
+       struct otx_ep_droq *droq = rx_queue;
+       struct otx_ep_device *otx_ep;
+       struct rte_mbuf *oq_pkt;
+
+       uint32_t pkts = 0;
+       uint32_t new_pkts = 0;
+       int next_fetch;
+
+       otx_ep = droq->otx_ep_dev;
+
+       if (droq->pkts_pending > budget) {
+               new_pkts = budget;
+       } else {
+               new_pkts = droq->pkts_pending;
+               new_pkts += otx_ep_check_droq_pkts(droq);
+               if (new_pkts > budget)
+                       new_pkts = budget;
+       }
+       if (!new_pkts) {
+               /* otx_ep_dbg("Zero new_pkts:%d\n", new_pkts); */
+               goto update_credit; /* No pkts at this moment */
+       }
+
+       /* otx_ep_dbg("Received new_pkts = %d\n", new_pkts); */
+
+       for (pkts = 0; pkts < new_pkts; pkts++) {
+               /* Push the received pkt to application */
+               next_fetch = (pkts == new_pkts - 1) ? 0 : 1;
+               oq_pkt = otx_ep_droq_read_packet(otx_ep, droq, next_fetch);
+               if (!oq_pkt) {
+                       otx_ep_err("DROQ read pkt failed pending %lu last_pkt_count 
%lu new_pkts %d.\n",
+                                  droq->pkts_pending, droq->last_pkt_count,

Both 'pkts_pending' & 'last_pkt_count' are 64bit and using '%lu' format specifier breaks the build for 32bit:

error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Werror=format=]


Can you please use 'PRIu64' instead?

Reply via email to