diff mbox series

[ovs-dev,v2,4/4] ofproto-dpif-monitor: Remove unneeded calls to clear packets.

Message ID 20240130221439.24297-4-mkp@redhat.com
State Changes Requested
Headers show
Series [ovs-dev,v2,1/4] dp-packet: Validate correct offset for L4 inner size. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Mike Pattrick Jan. 30, 2024, 10:14 p.m. UTC
Currently the monitor will call dp_packet_clear() on the dp_packet that
is shared amongst BFD, LLDP, and CFM. However, all of these packets are
created with eth_compose(), which already calls dp_packet_clear().

Signed-off-by: Mike Pattrick <mkp@redhat.com>
---
 ofproto/ofproto-dpif-monitor.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

David Marchand Jan. 31, 2024, 3:06 p.m. UTC | #1
On Tue, Jan 30, 2024 at 11:15 PM Mike Pattrick <mkp@redhat.com> wrote:
>
> Currently the monitor will call dp_packet_clear() on the dp_packet that
> is shared amongst BFD, LLDP, and CFM. However, all of these packets are
> created with eth_compose(), which already calls dp_packet_clear().
>
> Signed-off-by: Mike Pattrick <mkp@redhat.com>

Reviewed-by: David Marchand <david.marchand@redhat.com>
diff mbox series

Patch

diff --git a/ofproto/ofproto-dpif-monitor.c b/ofproto/ofproto-dpif-monitor.c
index bb0e49091..5132f9c95 100644
--- a/ofproto/ofproto-dpif-monitor.c
+++ b/ofproto/ofproto-dpif-monitor.c
@@ -275,19 +275,16 @@  monitor_mport_run(struct mport *mport, struct dp_packet *packet)
     long long int lldp_wake_time = LLONG_MAX;
 
     if (mport->cfm && cfm_should_send_ccm(mport->cfm)) {
-        dp_packet_clear(packet);
         cfm_compose_ccm(mport->cfm, packet, mport->hw_addr);
         ofproto_dpif_send_packet(mport->ofport, false, packet);
     }
     if (mport->bfd && bfd_should_send_packet(mport->bfd)) {
         bool oam;
 
-        dp_packet_clear(packet);
         bfd_put_packet(mport->bfd, packet, mport->hw_addr, &oam);
         ofproto_dpif_send_packet(mport->ofport, oam, packet);
     }
     if (mport->lldp && lldp_should_send_packet(mport->lldp)) {
-        dp_packet_clear(packet);
         lldp_put_packet(mport->lldp, packet, mport->hw_addr);
         ofproto_dpif_send_packet(mport->ofport, false, packet);
     }