From patchwork Sun Mar 25 14:18:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Yanjun X-Patchwork-Id: 10306629 X-Patchwork-Delegate: jgg@ziepe.ca 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 B296B605BD for ; Sun, 25 Mar 2018 14:19:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1C07293CB for ; Sun, 25 Mar 2018 14:19:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94908293D5; Sun, 25 Mar 2018 14:19:12 +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 33D7C293D3 for ; Sun, 25 Mar 2018 14:19:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752629AbeCYOTK (ORCPT ); Sun, 25 Mar 2018 10:19:10 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:33736 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753229AbeCYOTJ (ORCPT ); Sun, 25 Mar 2018 10:19:09 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2PEHI8Y117046; Sun, 25 Mar 2018 14:19:04 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=pOxNLLw7w9pMIs9FYz0ZNBgBt1Hl/Gj5L159mZfFqYY=; b=o8LAwb4QYbkrhZ8e6qZVpYjXT7tQKoPaLcV3y4I1an0zGErF9H5PV573IF0ujVjISzyr ofVuLmTsjQh6/smkafdDR7PUVNTLl3Mm+zdMAi+h6nRIPoV1emtdN4ZQMzuW+jkSElJ4 6mQ4UGhAw74U7jvU4iCynX9pKal4XjtqbiMURCjuGGViiCpbJkfZaXjfrA39PV4C8Tpx iWRnKu5L+uL7HgsXcJYR7ZI4cLR4fcZhsYhskVUizAsAxdGBNZglr/mv3Ka8COuAvTUz vNfceDMbb6vYpLfHhkbSyNRiJ3oJ++kvOC+gFVV2k+ESbwRTS/JbNVU7zU4ESz91SuTw jA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2gxddb00dx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 25 Mar 2018 14:19:03 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2PEJ2gk026303 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 25 Mar 2018 14:19:03 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w2PEJ1dJ007689; Sun, 25 Mar 2018 14:19:02 GMT Received: from shipfan.cn.oracle.com (/10.113.210.105) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 25 Mar 2018 14:19:01 +0000 From: Zhu Yanjun To: monis@mellanox.com, dledford@redhat.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org Subject: [PATCH 1/2] IB/rxe: make rxe_find_route6 compact Date: Sun, 25 Mar 2018 10:18:01 -0400 Message-Id: <1521987482-15095-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=8843 signatures=668695 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=793 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803250173 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 --- 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)