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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CDD5CA9EA0 for ; Fri, 18 Oct 2019 23:27:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C2C82089C for ; Fri, 18 Oct 2019 23:27:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OOjCw69k" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732802AbfJRX1q (ORCPT ); Fri, 18 Oct 2019 19:27:46 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:44891 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726374AbfJRX1q (ORCPT ); Fri, 18 Oct 2019 19:27:46 -0400 Received: by mail-qt1-f194.google.com with SMTP id u40so11488681qth.11 for ; Fri, 18 Oct 2019 16:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pIIERnZFKY1f0jc9H3Cykl1prQG4BDlyOgMmrh0Tb9I=; b=OOjCw69kqdoOHXJ1W07K+hRZWq1xR0XO4JGQqiLiqPbNUca10eXyDlJhCiPz7egXu5 /bQl/KguVx6rIpin/gwZ56K/znWkJ+52Q69zkX6XyS3+PjwOcbstObKX1hH6ITjZHiSg x9hyTzLzdfE3DkBpzgSQq/TfwHsTxRQMwc2BdoeIJT1Oru9ik2bwB353e9AAa1Xv+FIU gD0g+7nw+j+MImMiNbABrHBELnzLeyZ9G3AfCtnK96s2i4Vq9z8KfuxO8ZwqLmM7XvyD rxISyRV1ZSOMO1k58YaHIe7h2LdNPqWQafO0lN7bKec66F8rI7ElE7VFXWCUB9nkODNB FiKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pIIERnZFKY1f0jc9H3Cykl1prQG4BDlyOgMmrh0Tb9I=; b=tH/LGoJjB2srDWsYVm53/FmrcVKhOeJUkT3jhPpbzJqbJrfoSWA8G+Nwhg+LrIT+ev /VU/L/2/ZZuBAFHTE6/EY7t7pDo3YAKteLBQSPNlTS7YnTaTMSa1flmbSNaU5JkDL/bh LF1YwYfsApAFdf64OJ0wtXQqpq6hgV6FhV9Lv71tSX1Wj37IwFZpnAhYFSAkAosj9aYn HaSHRF61vk9xBPf1l519uhHjGOjFZbwMrO5GWnjFhUcjOwgYq+g5pNhYsd9qIaPNR6Rv olevfbxOqE9qrrWdjxYR4EOfm8GsJMGPqati3jrXNipFMifTZgxVrnLmrwKcWFa4KpTH EzDw== X-Gm-Message-State: APjAAAVfeSCCM4Dj5fwJNGcSWzB8eJB85pGmVCGCrt1yDNyB22JZqFiO szxZILD1Lqhgpq3IHn4mJ8NZZLeRWRPetexPfGt7Exjl X-Google-Smtp-Source: APXvYqyEstx7f8MPFqnVUPMmbOE4vhZBOkf2ZMHqcb9r9AFMi9nIaXhW9chzmKMFW62zfS0HKVH+ruBU1JORE5jE7Hs= X-Received: by 2002:ac8:23e8:: with SMTP id r37mr12885283qtr.365.1571441263788; Fri, 18 Oct 2019 16:27:43 -0700 (PDT) MIME-Version: 1.0 References: <1571135440-24313-1-git-send-email-xiangxia.m.yue@gmail.com> <1571135440-24313-7-git-send-email-xiangxia.m.yue@gmail.com> In-Reply-To: <1571135440-24313-7-git-send-email-xiangxia.m.yue@gmail.com> From: William Tu Date: Fri, 18 Oct 2019 16:27:07 -0700 Message-ID: Subject: Re: [ovs-dev] [PATCH net-next v4 06/10] net: openvswitch: simplify the flow_hash To: xiangxia.m.yue@gmail.com Cc: Greg Rose , pravin shelar , "" , Linux Kernel Network Developers Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Oct 16, 2019 at 5:54 AM wrote: > > From: Tonghao Zhang > > Simplify the code and remove the unnecessary BUILD_BUG_ON. > > Signed-off-by: Tonghao Zhang > Tested-by: Greg Rose > --- LGTM Acked-by: William Tu > net/openvswitch/flow_table.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c > index a10d421..3e3d345 100644 > --- a/net/openvswitch/flow_table.c > +++ b/net/openvswitch/flow_table.c > @@ -432,13 +432,9 @@ int ovs_flow_tbl_flush(struct flow_table *flow_table) > static u32 flow_hash(const struct sw_flow_key *key, > const struct sw_flow_key_range *range) > { > - int key_start = range->start; > - int key_end = range->end; > - const u32 *hash_key = (const u32 *)((const u8 *)key + key_start); > - int hash_u32s = (key_end - key_start) >> 2; > - > + const u32 *hash_key = (const u32 *)((const u8 *)key + range->start); > /* Make sure number of hash bytes are multiple of u32. */ > - BUILD_BUG_ON(sizeof(long) % sizeof(u32)); > + int hash_u32s = range_n_bytes(range) >> 2; > > return jhash2(hash_key, hash_u32s, 0); > } > -- > 1.8.3.1 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev