[ovs-dev] [PATCH v2 ovn] controller: fix pkt_marking with IP buffering
Numan Siddique
numans at ovn.org
Wed Jan 27 09:27:58 UTC 2021
On Mon, Jan 25, 2021 at 6:59 PM Lorenzo Bianconi
<lorenzo.bianconi at redhat.com> wrote:
>
> Reload pkt_marking metadata for cloned packets during ARP/ND address
> resolution.
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1857106
>
> Tested-by: Jianlin Shi <jishi at redhat.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi at redhat.com>
> ---
> Changes since v1:
> - rely on check and fetch_column in ovn.at
Thanks Lorenzo. I applied patch to master and backported to
branch-20.12 and branch-20.09.
Numan
> ---
> controller/pinctrl.c | 5 +++++
> tests/ovn.at | 10 ++++++++++
> 2 files changed, 15 insertions(+)
>
> diff --git a/controller/pinctrl.c b/controller/pinctrl.c
> index 5f72c0e07..dcf6b4af5 100644
> --- a/controller/pinctrl.c
> +++ b/controller/pinctrl.c
> @@ -1399,6 +1399,11 @@ buffered_push_packet(struct buffered_packets *bp,
> ofpbuf_init(&bi->ofpacts, 4096);
>
> reload_metadata(&bi->ofpacts, md);
> + /* reload pkt_mark field */
> + const struct mf_field *pkt_mark_field = mf_from_id(MFF_PKT_MARK);
> + union mf_value pkt_mark_value;
> + mf_get_value(pkt_mark_field, &md->flow, &pkt_mark_value);
> + ofpact_put_set_field(&bi->ofpacts, pkt_mark_field, &pkt_mark_value, NULL);
> bi->ofp_port = md->flow.in_port.ofp_port;
>
> struct ofpact_resubmit *resubmit = ofpact_put_RESUBMIT(&bi->ofpacts);
> diff --git a/tests/ovn.at b/tests/ovn.at
> index 718b2eec5..7964f568d 100644
> --- a/tests/ovn.at
> +++ b/tests/ovn.at
> @@ -15987,6 +15987,14 @@ ovn-nbctl --wait=hv sync
> ovn-sbctl dump-flows > sbflows2
> AT_CAPTURE_FILE([sbflows2])
>
> +# create a route policy for pkt marking
> +check ovn-nbctl lr-policy-add lr0 2000 "ip4.src == 192.168.1.3" allow
> +policy=$(fetch_column nb:Logical_Router_Policy _uuid priority=2000)
> +check ovn-nbctl set logical_router_policy $policy options:pkt_mark=100
> +as hv2
> +# add a flow in egress pipeline to check pkt marking
> +ovs-ofctl --protocols=OpenFlow13 add-flow br-int "table=32,priority=200,ip,nw_src=172.16.1.2,pkt_mark=0x64 actions=resubmit(,33)"
> +
> dst_ip=$(ip_to_hex 172 16 2 10)
> fip_ip=$(ip_to_hex 172 16 1 2)
> src_ip=$(ip_to_hex 192 168 1 3)
> @@ -15997,6 +16005,8 @@ echo $(get_arp_req f00000010204 $fip_ip $gw_router_ip) >> expected
> send_arp_reply 2 1 $gw_router_mac f00000010204 $gw_router_ip $fip_ip
> echo "${gw_router_mac}f0000001020408004500001c00004000fe0121b4${fip_ip}${dst_ip}${data}" >> expected
>
> +AT_CHECK([as hv2 ovs-ofctl dump-flows br-int table=32 | grep pkt_mark=0x64 | grep -q n_packets=1],[0])
> +
> OVN_CHECK_PACKETS([hv2/vif1-tx.pcap], [expected])
>
> OVN_CLEANUP([hv1],[hv2])
> --
> 2.29.2
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
More information about the dev
mailing list