[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220315085258.40578edd@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Tue, 15 Mar 2022 08:52:58 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Roi Dayan <roid@...dia.com>
Cc: netdev@...r.kernel.org, Maor Dickman <maord@...dia.com>,
"David S. Miller" <davem@...emloft.net>,
Jamal Hadi Salim <jhs@...atatu.com>,
Jiri Pirko <jiri@...dia.com>
Subject: Re: [PATCH net-next 2/3] net/mlx5e: MPLSoUDP decap, use vlan
push_eth instead of pedit
On Tue, 15 Mar 2022 11:50:46 +0200 Roi Dayan wrote:
> On 2022-03-15 7:02 AM, Jakub Kicinski wrote:
> > On Wed, 9 Mar 2022 15:02:55 +0200 Roi Dayan wrote:
> >> + case FLOW_ACTION_VLAN_PUSH_ETH:
> >> + if (!flow_flag_test(parse_state->flow, L3_TO_L2_DECAP))
> >> + return -EOPNOTSUPP;
> >> + parse_state->eth_push = true;
> >> + memcpy(attr->eth.h_dest, act->vlan_push_eth_dst, ETH_ALEN);
> >> + memcpy(attr->eth.h_source, act->vlan_push_eth_src, ETH_ALEN);
> >> + break;
> >
> > How does the device know the proto? I kind of expected this code will
> > require some form of a match on proto.
>
> Vlan push_eth doesn't handle the protocol, it only push src/dst mac.
>
> From tc-vlan man page:
> PUSH_ETH := push_eth dst_mac LLADDR src_mac LLADDR
It uses the protocol from skb.
> In the case of MPLSoUDP the protocol is set by mpls pop action,
> prior to the vlan push_eth action.
>
> Example:
> action order 2: mpls pop protocol ip pipe
> index 2 ref 1 bind 1
> used_hw_stats delayed
>
> action order 3: vlan push_eth dst_mac de:a2:ec:d6:69:c8
> src_mac de:a2:ec:d6:69:c8 pipe
> index 2 ref 1 bind 1
> used_hw_stats delayed
Ack, I was basically asking how the existence of an earlier mpls pop
gets enforced by the driver.
Powered by blists - more mailing lists