mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
dpif-netdev: Replace loop iterating over packet batch with macro.
The function dp_netdev_pmd_flush_output_on_port() iterates over the p->output_pkts batch directly, when it should be using the special iterator macro, DP_PACKET_BATCH_FOR_EACH. However, this wasn't possible because the macro could not accept &p->output_pkts. The addition of parentheses when BATCH is dereferenced allows the macro to expand properly. Parenthesizing arguments in macros is good practice to be able to handle whichever expressions are passed in. Signed-off-by: Rosemarie O'Riorden <roriorden@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
committed by
Ilya Maximets
parent
8523ee2f8a
commit
7e7083cc46
@@ -5210,8 +5210,8 @@ dp_netdev_pmd_flush_output_on_port(struct dp_netdev_pmd_thread *pmd,
|
||||
int n_txq = netdev_n_txq(p->port->netdev);
|
||||
|
||||
/* Re-batch per txq based on packet hash. */
|
||||
for (i = 0; i < output_cnt; i++) {
|
||||
struct dp_packet *packet = p->output_pkts.packets[i];
|
||||
struct dp_packet *packet;
|
||||
DP_PACKET_BATCH_FOR_EACH (j, packet, &p->output_pkts) {
|
||||
uint32_t hash;
|
||||
|
||||
if (OVS_LIKELY(dp_packet_rss_valid(packet))) {
|
||||
|
Reference in New Issue
Block a user