From patchwork Sat Mar 31 04:18:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Yanjun X-Patchwork-Id: 10318675 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 078966055B for ; Sat, 31 Mar 2018 04:19:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF6BC29B04 for ; Sat, 31 Mar 2018 04:19:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2A0529B45; Sat, 31 Mar 2018 04:19:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EACD29B04 for ; Sat, 31 Mar 2018 04:19:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750776AbeCaETn (ORCPT ); Sat, 31 Mar 2018 00:19:43 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:54890 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750718AbeCaETn (ORCPT ); Sat, 31 Mar 2018 00:19:43 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2V4HqXP084551; Sat, 31 Mar 2018 04:19:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id; s=corp-2017-10-26; bh=Pr1nPI2myGI/8LOcLzdX50ZeeohWwR0rXx9yFL5VwX8=; b=MR09/Z+eOsUkW083N7xGN5eb+fVpg6tWlbU5WRksxHdpXyZBKJ6ckT92FQNWDWNOE0Fr EdP+1i7/0HF9YKoc1U7lCyyQjceyaHWLV/Yy8GyS0iMUv+7HdndUCHtjqSjqAnr8HdIk j2pWPKdStokM5w1ZSgOu1z+SvRlQXT+IX9wokWPKm283Fdy1nAPBVZf6HyuuCJfQLl8y sbQEaz7zMYopVI4fMNfAVqK6MjWo7ZpH5ZaOBkOjVE/nD4zTO2Bge21Qi0/s6oNNgYSq AQzvg3W5ivZ5B0/fqZvuMVAr2U+B+RYUtLrlsBGHG1n8lRXd01EknXRP9mktZ2Dg5qYB mg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2h236a8014-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 31 Mar 2018 04:19:36 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2V4JZqm008652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 31 Mar 2018 04:19:35 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w2V4JYr3016361; Sat, 31 Mar 2018 04:19:35 GMT Received: from shipfan.cn.oracle.com (/10.113.210.105) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 30 Mar 2018 21:19:34 -0700 From: Zhu Yanjun To: monis@mellanox.com, dledford@redhat.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org Subject: [PATCHv3 1/2] B/rxe: make rxe_find_route6 compact Date: Sat, 31 Mar 2018 00:18:25 -0400 Message-Id: <1522469906-4745-1-git-send-email-yanjun.zhu@oracle.com> X-Mailer: git-send-email 2.7.4 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8848 signatures=668697 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=748 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803310040 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the file rxe_net.c, to make rxe_find_route6 compact, IPV6_CONFIG is moved into the function rxe_find_route6. CC: Srinivas Eeda CC: Junxiao Bi Signed-off-by: Zhu Yanjun --- V2->V3: Fix compile error. V1->V2: Follow Jason's advice, remove #if. --- drivers/infiniband/sw/rxe/rxe_net.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c index 159246b..4fc3941 100644 --- a/drivers/infiniband/sw/rxe/rxe_net.c +++ b/drivers/infiniband/sw/rxe/rxe_net.c @@ -140,11 +140,11 @@ static struct dst_entry *rxe_find_route4(struct net_device *ndev, return &rt->dst; } -#if IS_ENABLED(CONFIG_IPV6) static struct dst_entry *rxe_find_route6(struct net_device *ndev, struct in6_addr *saddr, struct in6_addr *daddr) { +#if IS_ENABLED(CONFIG_IPV6) struct dst_entry *ndst; struct flowi6 fl6 = { { 0 } }; @@ -168,20 +168,10 @@ static struct dst_entry *rxe_find_route6(struct net_device *ndev, return ndst; put: dst_release(ndst); +#endif return NULL; } -#else - -static struct dst_entry *rxe_find_route6(struct net_device *ndev, - struct in6_addr *saddr, - struct in6_addr *daddr) -{ - return NULL; -} - -#endif - static struct dst_entry *rxe_find_route(struct rxe_dev *rxe, struct rxe_qp *qp, struct rxe_av *av)