netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: yue longguang <yuelongguang@gmail.com>
To: "longguang.yue" <bigclouds@163.com>
Cc: Wensong Zhang <wensong@linux-vs.org>,
	Simon Horman <horms@verge.net.au>, Julian Anastasov <ja@ssi.bg>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Jozsef Kadlecsik <kadlec@netfilter.org>,
	Florian Westphal <fw@strlen.de>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	"open list:IPVS" <netdev@vger.kernel.org>,
	"open list:IPVS" <lvs-devel@vger.kernel.org>,
	"open list:NETFILTER" <netfilter-devel@vger.kernel.org>,
	"open list:NETFILTER" <coreteam@netfilter.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ipvs: Add traffic statistic up even it is VS/DR or VS/TUN mode
Date: Tue, 29 Sep 2020 13:17:20 +0800	[thread overview]
Message-ID: <CAPaK2r__afG7epSM6As3SehhCvTk4KvXB_UjQuwjCNZmf-giGA@mail.gmail.com> (raw)
In-Reply-To: <20200929050302.28105-1-bigclouds@163.com>

especially in public cloud case, statistic is related to monitorring
and billing , both ingress and egress packets will go throught ipvs,
even dr/tun mode.
in dr/tun mode, ipvs need to do nothing except  statistic, so
skb->ipvs_property = 1

regards

On Tue, Sep 29, 2020 at 1:04 PM longguang.yue <bigclouds@163.com> wrote:
>
> It's ipvs's duty to do traffic statistic if packets get hit,
> no matter what mode it is.
>
> Signed-off-by: longguang.yue <bigclouds@163.com>
> ---
>  net/netfilter/ipvs/ip_vs_core.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
> index e3668a6e54e4..ed523057f07f 100644
> --- a/net/netfilter/ipvs/ip_vs_core.c
> +++ b/net/netfilter/ipvs/ip_vs_core.c
> @@ -1413,8 +1413,11 @@ ip_vs_out(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, in
>                              ipvs, af, skb, &iph);
>
>         if (likely(cp)) {
> -               if (IP_VS_FWD_METHOD(cp) != IP_VS_CONN_F_MASQ)
> +               if (IP_VS_FWD_METHOD(cp) != IP_VS_CONN_F_MASQ){
> +                       ip_vs_out_stats(cp, skb);
> +                       skb->ipvs_property = 1;
>                         goto ignore_cp;
> +               }
>                 return handle_response(af, skb, pd, cp, &iph, hooknum);
>         }
>
> --
> 2.20.1 (Apple Git-117)
>

  reply	other threads:[~2020-09-29  5:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29  5:03 [PATCH] ipvs: Add traffic statistic up even it is VS/DR or VS/TUN mode longguang.yue
2020-09-29  5:17 ` yue longguang [this message]
2020-09-29  8:18 ` [PATCH v2] " longguang.yue
2020-09-29 14:41   ` Jakub Kicinski
2020-09-30  1:26     ` [PATCH v3] " longguang.yue
2020-09-30 18:19       ` Julian Anastasov
2020-10-02 17:17         ` [PATCH v4] " longguang.yue
2020-10-02 19:26           ` Julian Anastasov
2020-10-04  4:13             ` [PATCH v5] " longguang.yue
2020-10-04 12:25               ` Julian Anastasov
2020-10-04 15:07                 ` [PATCH v6] ipvs: inspect reply packets from DR/TUN real servers longguang.yue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPaK2r__afG7epSM6As3SehhCvTk4KvXB_UjQuwjCNZmf-giGA@mail.gmail.com \
    --to=yuelongguang@gmail.com \
    --cc=bigclouds@163.com \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=horms@verge.net.au \
    --cc=ja@ssi.bg \
    --cc=kadlec@netfilter.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvs-devel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=wensong@linux-vs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).