From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA340C04FDE for ; Fri, 9 Dec 2022 15:22:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230319AbiLIPWK (ORCPT ); Fri, 9 Dec 2022 10:22:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230378AbiLIPVs (ORCPT ); Fri, 9 Dec 2022 10:21:48 -0500 Received: from mail.netfilter.org (mail.netfilter.org [217.70.188.207]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 103D08D194 for ; Fri, 9 Dec 2022 07:21:46 -0800 (PST) Date: Fri, 9 Dec 2022 16:21:41 +0100 From: Pablo Neira Ayuso To: Xin Long Cc: network dev , dev@openvswitch.org, davem@davemloft.net, kuba@kernel.org, Eric Dumazet , Paolo Abeni , Pravin B Shelar , Jamal Hadi Salim , Cong Wang , Jiri Pirko , Florian Westphal , Marcelo Ricardo Leitner , Davide Caratti , Oz Shlomo , Paul Blakey , Ilya Maximets , Eelco Chaudron , Aaron Conole , Saeed Mahameed Subject: Re: [PATCHv4 net-next 5/5] net: move the nat function to nf_nat_ovs for ovs and tc Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Dec 08, 2022 at 11:56:12AM -0500, Xin Long wrote: > There are two nat functions are nearly the same in both OVS and > TC code, (ovs_)ct_nat_execute() and ovs_ct_nat/tcf_ct_act_nat(). > > This patch creates nf_nat_ovs.c under netfilter and moves them > there then exports nf_ct_nat() so that it can be shared by both > OVS and TC, and keeps the nat (type) check and nat flag update > in OVS and TC's own place, as these parts are different between > OVS and TC. > > Note that in OVS nat function it was using skb->protocol to get > the proto as it already skips vlans in key_extract(), while it > doesn't in TC, and TC has to call skb_protocol() to get proto. > So in nf_ct_nat_execute(), we keep using skb_protocol() which > works for both OVS and TC contrack. > > Signed-off-by: Xin Long Acked-by: Pablo Neira Ayuso Thanks for addressing my feedback.