On 28 Oct 2026, at 18:26, David Marchand via dev wrote:

> On Thu, 8 Oct 2026 at 15:36, Eelco Chaudron <[email protected]> wrote:
>> [...]
>>
>>> +    if (policer) {
>>> +        ovsrcu_postpone__((void (*)(void *)) 
>>> dpdk_qos_ingress_policer_destruct,
>>> +                          policer);
>>
>> Could this use ovsrcu_postpone() directly?  The types
>> match: dpdk_qos_ingress_policer_destruct() takes a
>> 'struct dpdk_qos_ingress_policer *' and 'policer' is
>> the same type.
>
> Indeed.
> This is probably a leftover of some experiment I did.
> I can probably call free() like in original code, I'll double check.
>
>
>>> diff --git a/lib/netdev-dpdk-common.h b/lib/netdev-dpdk-common.h
>>
>> [...]
>>
>>> +void dpdk_qos_ingress_policer_destruct(struct dpdk_qos_ingress_policer *);
>>> +int dpdk_qos_ingress_policer_run(struct dpdk_qos_ingress_policer *policer,
>>
>> Per the coding style, parameter names can be omitted
>> from prototypes when the type already makes the purpose
>> clear.  For instance 'policer' here, 'common' below, and
>> similar struct pointer parameters throughout this move.
>> Also true for earlier patches.
>
> Well, I just moved code.
>
> On the other hand, every time I submit a patch with "omitted" names, I
> get Ilya asking me to add explicit names :-).
> So please, give me an explicit list of things to adjust, else I prefer
> to leave as is.

See my diff below. @Iyla, what are your thoughts on this? I feel like this is a 
new file, so we might as well fix it now.

//Eelco


diff --git a/lib/netdev-dpdk-common.h b/lib/netdev-dpdk-common.h
index a9bba274a..91067ebf7 100644
--- a/lib/netdev-dpdk-common.h
+++ b/lib/netdev-dpdk-common.h
@@ -45,12 +45,10 @@ extern struct ovs_mutex dpdk_vhost_mutex;
 extern struct ovs_mutex dpdk_mp_mutex
     OVS_ACQ_AFTER(dpdk_eth_mutex, dpdk_vhost_mutex);

-/*
- * need to reserve tons of extra space in the mbufs so we can align the
+/* Need to reserve tons of extra space in the mbufs so we can align the
  * DMA addresses to 4KB.
  * The minimum mbuf size is limited to avoid scatter behaviour and drop in
- * performance for standard Ethernet MTU.
- */
+ * performance for standard Ethernet MTU. */
 #define ETHER_HDR_MAX_LEN           (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN \
                                      + (2 * VLAN_HEADER_LEN))
 #define MTU_TO_FRAME_LEN(mtu)       ((mtu) + RTE_ETHER_HDR_LEN + \
@@ -165,18 +163,16 @@ enum dpdk_hw_ol_features {
     NETDEV_TX_GRE_TNL_TSO_OFFLOAD = 1 << 12,
 };

-void netdev_dpdk_common_update_ol_flags(struct netdev_dpdk_common *common);
+void netdev_dpdk_common_update_ol_flags(struct netdev_dpdk_common *);

-int netdev_dpdk_common_get_numa_id(const struct netdev *netdev);
-void netdev_dpdk_common_get_etheraddr(const struct netdev_dpdk_common *common,
-                                     struct eth_addr *mac);
-void netdev_dpdk_common_get_mtu(const struct netdev_dpdk_common *common,
-                               int *mtup);
-int netdev_dpdk_common_get_ifindex(const struct netdev_dpdk_common *common);
-int netdev_dpdk_common_set_mtu(struct netdev_dpdk_common *common, int mtu);
-void
-netdev_dpdk_common_get_sw_custom_stats(struct netdev_dpdk_common *common,
-                                       struct netdev_custom_stats *stats);
+int netdev_dpdk_common_get_numa_id(const struct netdev *);
+void netdev_dpdk_common_get_etheraddr(const struct netdev_dpdk_common *,
+                                     struct eth_addr *);
+void netdev_dpdk_common_get_mtu(const struct netdev_dpdk_common *, int *mtup);
+int netdev_dpdk_common_get_ifindex(const struct netdev_dpdk_common *);
+int netdev_dpdk_common_set_mtu(struct netdev_dpdk_common *, int mtu);
+void netdev_dpdk_common_get_sw_custom_stats(struct netdev_dpdk_common *,
+                                            struct netdev_custom_stats *);

 /* Allocates an area of 'sz' bytes from DPDK.  The memory is zero'ed.
  *
@@ -199,68 +195,67 @@ struct dpdk_mp_config {

 void dpdk_mp_init(const struct smap *ovs_other_config);
 bool dpdk_mp_per_port_memory(void);
-struct dpdk_mp * dpdk_mp_get(struct dpdk_mp_config *cfg);
-void dpdk_mp_put(struct dpdk_mp *dmp);
-void dpdk_mp_dump(FILE *stream, struct dpdk_mp *dmp);
+struct dpdk_mp * dpdk_mp_get(struct dpdk_mp_config *);
+void dpdk_mp_put(struct dpdk_mp *);
+void dpdk_mp_dump(FILE *stream, struct dpdk_mp *);

 /* Quality of Service */

-int dpdk_qos_run(struct dpdk_qos_conf *qos_conf, struct rte_mbuf **pkts,
+int dpdk_qos_run(struct dpdk_qos_conf *, struct rte_mbuf **pkts,
                  int pkt_cnt, bool should_steal);

 /* Ingress policer */
 struct dpdk_qos_ingress_policer *
     dpdk_qos_ingress_policer_construct(uint32_t rate, uint32_t burst);
 void dpdk_qos_ingress_policer_destruct(struct dpdk_qos_ingress_policer *);
-int dpdk_qos_ingress_policer_run(struct dpdk_qos_ingress_policer *policer,
+int dpdk_qos_ingress_policer_run(struct dpdk_qos_ingress_policer *,
                                  struct rte_mbuf **pkts, int pkt_cnt,
                                  bool should_steal);

-int netdev_dpdk_common_set_policing(struct netdev_dpdk_common *common,
+int netdev_dpdk_common_set_policing(struct netdev_dpdk_common *,
                                     uint32_t policer_rate,
                                     uint32_t policer_burst);

-int netdev_dpdk_common_get_qos_types(const struct netdev *netdev,
+int netdev_dpdk_common_get_qos_types(const struct netdev *,
                                      struct sset *types);
-int netdev_dpdk_common_get_qos(const struct netdev_dpdk_common *common,
+int netdev_dpdk_common_get_qos(const struct netdev_dpdk_common *,
                                const char **typep, struct smap *details);
-int netdev_dpdk_common_set_qos(struct netdev_dpdk_common *common,
+int netdev_dpdk_common_set_qos(struct netdev_dpdk_common *,
                                const char *type, const struct smap *details);
-int netdev_dpdk_common_get_queue(const struct netdev_dpdk_common *common,
+int netdev_dpdk_common_get_queue(const struct netdev_dpdk_common *,
                                  uint32_t queue_id, struct smap *details);
-int netdev_dpdk_common_set_queue(struct netdev_dpdk_common *common,
+int netdev_dpdk_common_set_queue(struct netdev_dpdk_common *,
                                  uint32_t queue_id,
                                  const struct smap *details);
-int netdev_dpdk_common_delete_queue(struct netdev_dpdk_common *common,
+int netdev_dpdk_common_delete_queue(struct netdev_dpdk_common *,
                                     uint32_t queue_id);
-int netdev_dpdk_common_get_queue_stats(const struct netdev_dpdk_common *common,
+int netdev_dpdk_common_get_queue_stats(const struct netdev_dpdk_common *,
                                        uint32_t queue_id,
-                                       struct netdev_queue_stats *stats);
+                                       struct netdev_queue_stats *);
 int
-netdev_dpdk_common_queue_dump_start(const struct netdev_dpdk_common *common,
+netdev_dpdk_common_queue_dump_start(const struct netdev_dpdk_common *,
                                     void **statep);
-int netdev_dpdk_common_queue_dump_next(const struct netdev_dpdk_common *common,
+int netdev_dpdk_common_queue_dump_next(const struct netdev_dpdk_common *,
                                        void *state_, uint32_t *queue_idp,
                                        struct smap *details);
-int netdev_dpdk_common_queue_dump_done(const struct netdev *netdev,
-                                       void *state_);
+int netdev_dpdk_common_queue_dump_done(const struct netdev *, void *state_);

 void netdev_dpdk_mbuf_dump(const char *prefix, const char *message,
-                           const struct rte_mbuf *mbuf);
+                           const struct rte_mbuf *);

 void netdev_dpdk_common_vlog_rl(enum vlog_level, const char *format, ...)
     OVS_PRINTF_FORMAT(2, 3);

 uint32_t netdev_dpdk_extbuf_size(uint32_t data_len);
 void *netdev_dpdk_extbuf_allocate(uint32_t buf_len);
-void netdev_dpdk_extbuf_replace(struct dp_packet *b, void *buf,
+void netdev_dpdk_extbuf_replace(struct dp_packet *, void *buf,
                                 uint32_t data_len);

-struct rte_mbuf *dpdk_pktmbuf_alloc(struct rte_mempool *mp, uint32_t data_len);
-struct dp_packet *dpdk_copy_dp_packet_to_mbuf(struct rte_mempool *mp,
-                                              struct dp_packet *pkt_orig);
-size_t dpdk_copy_batch_to_mbuf(struct netdev_dpdk_common *common,
-                               struct dp_packet_batch *batch);
+struct rte_mbuf *dpdk_pktmbuf_alloc(struct rte_mempool *, uint32_t data_len);
+struct dp_packet *dpdk_copy_dp_packet_to_mbuf(struct rte_mempool *,
+                                              struct dp_packet *);
+size_t dpdk_copy_batch_to_mbuf(struct netdev_dpdk_common *,
+                               struct dp_packet_batch *);

 /* Prepare the packet for HWOL.
  * Return True if the packet is OK to continue. */
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to