Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5399774imm; Tue, 16 Oct 2018 09:38:40 -0700 (PDT) X-Google-Smtp-Source: ACcGV639iKUzKMLQ0XzwiyIJv3tGzAc/h+mAQJpU+X9U81fCeTcBMG+PvaLy0BNYks12Hl6smMQu X-Received: by 2002:a65:5a05:: with SMTP id y5-v6mr17472782pgs.161.1539707920047; Tue, 16 Oct 2018 09:38:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539707920; cv=none; d=google.com; s=arc-20160816; b=YVPqyOz5Tx44qiVSfyFsbQasn1mz5JV8RtkFpnWmtyPXctE/9jTtSrvDoe8S4bciG5 XnIw1LVuV6MI7kuUjtgEeMO9otLC7n4zGByNcoMNsLGq+UgK3cKmEx5IdDKKwxoYra9k zD7piFzstnZs3N9LItCYD5edo5R6ppkXjWqLWkoqmNxL6rUFi0MmlCJ6X95As6npNU8f aMmN+gGSYF3+KrIMX4rnd/Kq3eUuNlrZEYcxtbEo6ADSuy5rz6B3f/cHIXzrZocr4R1I 5kIRppc4fUHOIVZSIXIfLEM+j1Yz/45x4FTq3FwFB3Y7muWS34JGeuirDkswhUizhVK3 GmFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=hIwgutW3wH9Tk/ML2VLUfmnCZUR1Mh5fdljm41t1W8I=; b=jfjwM6SSdLCxoFRJGIG6zv1yfBKm5zv+l4LoVFn6jKX4YGjrfOu4MAMqfOFfrn0xdZ sddjPE5uzktWJuYQo8TQsYHjVJ8nC3YPIm7Hh9CgV5kwGTHNyWjJmizXbdo+KSSQoX0/ rCqNQfP4o7Uv7lE1ZZ6YSGiegY9J567YpUL5Q5LHxrS6rDeK1qzWlpaKxEsO4WhfAAq6 l/BtDJ6qL5kpFg+mYFKDrZVms9vb4KekmMWx8+4qSJFVBXlnWeDlzt/aKeGV+Q7I92Nl iIAUFqtl+VOw1lW7v4a+mmiaBx5pbWh0v+hEJYQ5jEoWwB+seCrIPTL0/uYTAUMlJraQ TM+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=dz0VOjRt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k28-v6si14223489pgf.308.2018.10.16.09.38.23; Tue, 16 Oct 2018 09:38:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=dz0VOjRt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727333AbeJQA12 (ORCPT + 99 others); Tue, 16 Oct 2018 20:27:28 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:51892 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726778AbeJQA12 (ORCPT ); Tue, 16 Oct 2018 20:27:28 -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 w9GGTRTE148982; Tue, 16 Oct 2018 16:35:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=hIwgutW3wH9Tk/ML2VLUfmnCZUR1Mh5fdljm41t1W8I=; b=dz0VOjRt+DXvBvhkp9yMXhu9IIt8grdF9A1dM51qCWgy+cEKK+QWJh+suQLX3CxFTWPs Nkh+/uZ0Ym+lisEnq/ubaRTpLlDXVdl2lw+vquCpMax4IiyoWOyxyA8ns0kzRqki2M/a jVdN6odlByFQn3UQPiLK1JjAihew/mfnzdrAq8Nh5CT586bswx59N1bmnTFEQmTX7KK+ w9KoB1IpM0J4QkyrgiIm3GqwmVHaDL4GznlZz2167Pmw3q9MGjnF0eQHy2CsvIxjmXpD FrexzBBARaPHfLNU62mO1e7k/HKdth+kSIEelRwuJvETrtUU8xoVXGYm/WsIVkvqq7hd 1A== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2n38nq1y02-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Oct 2018 16:35:56 +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 w9GGZnAb030737 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Oct 2018 16:35:49 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w9GGZlvc025490; Tue, 16 Oct 2018 16:35:47 GMT Received: from [10.159.237.5] (/10.159.237.5) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 16 Oct 2018 09:35:47 -0700 Subject: Re: [PATCH net-next] ixgbe: fix XFRM_ALGO dependency To: Arnd Bergmann , Jeff Kirsher , "David S. Miller" , Steffen Klassert , Herbert Xu Cc: Jesse Brandeburg , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Alexander Duyck , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20181016100848.1329843-1-arnd@arndb.de> From: Shannon Nelson Organization: Oracle Corporation Message-ID: <07e372cb-06da-bf95-bc53-64ee09fc8e76@oracle.com> Date: Tue, 16 Oct 2018 09:35:44 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181016100848.1329843-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9047 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810160137 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/16/2018 3:03 AM, Arnd Bergmann wrote: > When XFRM_ALGO is not enabled, the new igxge ipsec code produces a > link error: s/igxge/ixgbe/ > > drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.o: In function `ixgbe_ipsec_vf_add_sa': > ixgbe_ipsec.c:(.text+0x1266): undefined reference to `xfrm_aead_get_byname' > > Simply selectin XFRM_ALGO from here causes circular dependencies, so s/selectin/selecting/ > to fix it, we probably want this slightly more complex solution that is > similar to what other drivers with XFRM offload do: > > A separate Kconfig symbol now controls whether we include the ipsec > offload code. To keep the old behavior, this is left as 'default y'. The > dependency in XFRM_OFFLOAD still causes a circular dependency but is > not actually needed because this symbol is not user visible, so removing > that dependency on top makes it all work. > > Fixes: eda0333ac293 ("ixgbe: add VF IPsec management") > Signed-off-by: Arnd Bergmann > --- > drivers/net/ethernet/intel/Kconfig | 10 ++++++++++ > drivers/net/ethernet/intel/ixgbe/Makefile | 2 +- > drivers/net/ethernet/intel/ixgbe/ixgbe.h | 8 ++++---- > drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 +++--- > net/xfrm/Kconfig | 1 - > 5 files changed, 18 insertions(+), 9 deletions(-) > > diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig > index b542aba6f0e8..d1db382d8299 100644 > --- a/drivers/net/ethernet/intel/Kconfig > +++ b/drivers/net/ethernet/intel/Kconfig > @@ -194,6 +194,16 @@ config IXGBE_DCB > > If unsure, say N. > > +config IXGBE_IPSEC > + bool "IPSec XFRM cryptography-offload accelaration" > + default n remove this "default n" line? > + depends on IXGBE > + depends on XFRM_OFFLOAD > + default y > + select XFRM_ALGO > + ---help--- > + Enable support for IPSec offload in ixgbe.ko > + > config IXGBEVF > tristate "Intel(R) 10GbE PCI Express Virtual Function Ethernet support" > depends on PCI_MSI > diff --git a/drivers/net/ethernet/intel/ixgbe/Makefile b/drivers/net/ethernet/intel/ixgbe/Makefile > index ca6b0c458e4a..4fb0d9e3f2da 100644 > --- a/drivers/net/ethernet/intel/ixgbe/Makefile > +++ b/drivers/net/ethernet/intel/ixgbe/Makefile > @@ -17,4 +17,4 @@ ixgbe-$(CONFIG_IXGBE_DCB) += ixgbe_dcb.o ixgbe_dcb_82598.o \ > ixgbe-$(CONFIG_IXGBE_HWMON) += ixgbe_sysfs.o > ixgbe-$(CONFIG_DEBUG_FS) += ixgbe_debugfs.o > ixgbe-$(CONFIG_FCOE:m=y) += ixgbe_fcoe.o > -ixgbe-$(CONFIG_XFRM_OFFLOAD) += ixgbe_ipsec.o > +ixgbe-$(CONFIG_IXGBE_IPSEC) += ixgbe_ipsec.o > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h > index 7a7679e7be84..1d5d66436eac 100644 > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h > @@ -770,9 +770,9 @@ struct ixgbe_adapter { > #define IXGBE_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */ > u32 *rss_key; > > -#ifdef CONFIG_XFRM_OFFLOAD > +#ifdef CONFIG_IXGBE_IPSEC > struct ixgbe_ipsec *ipsec; > -#endif /* CONFIG_XFRM_OFFLOAD */ > +#endif /* CONFIG_IXGBE_IPSEC */ You'll probably want to apply these changes to the ixgbevf code as well. Cheers, sln > > /* AF_XDP zero-copy */ > struct xdp_umem **xsk_umems; > @@ -1009,7 +1009,7 @@ void ixgbe_store_key(struct ixgbe_adapter *adapter); > void ixgbe_store_reta(struct ixgbe_adapter *adapter); > s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg, > u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm); > -#ifdef CONFIG_XFRM_OFFLOAD > +#ifdef CONFIG_IXGBE_IPSEC > void ixgbe_init_ipsec_offload(struct ixgbe_adapter *adapter); > void ixgbe_stop_ipsec_offload(struct ixgbe_adapter *adapter); > void ixgbe_ipsec_restore(struct ixgbe_adapter *adapter); > @@ -1037,5 +1037,5 @@ static inline int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, > u32 *mbuf, u32 vf) { return -EACCES; } > static inline int ixgbe_ipsec_vf_del_sa(struct ixgbe_adapter *adapter, > u32 *mbuf, u32 vf) { return -EACCES; } > -#endif /* CONFIG_XFRM_OFFLOAD */ > +#endif /* CONFIG_IXGBE_IPSEC */ > #endif /* _IXGBE_H_ */ > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c > index 0049a2becd7e..113b38e0defb 100644 > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c > @@ -8694,7 +8694,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, > > #endif /* IXGBE_FCOE */ > > -#ifdef CONFIG_XFRM_OFFLOAD > +#ifdef CONFIG_IXGBE_IPSEC > if (skb->sp && !ixgbe_ipsec_tx(tx_ring, first, &ipsec_tx)) > goto out_drop; > #endif > @@ -10190,7 +10190,7 @@ ixgbe_features_check(struct sk_buff *skb, struct net_device *dev, > * the TSO, so it's the exception. > */ > if (skb->encapsulation && !(features & NETIF_F_TSO_MANGLEID)) { > -#ifdef CONFIG_XFRM_OFFLOAD > +#ifdef CONFIG_IXGBE_IPSEC > if (!skb->sp) > #endif > features &= ~NETIF_F_TSO; > @@ -10883,7 +10883,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) > if (hw->mac.type >= ixgbe_mac_82599EB) > netdev->features |= NETIF_F_SCTP_CRC; > > -#ifdef CONFIG_XFRM_OFFLOAD > +#ifdef CONFIG_IXGBE_IPSEC > #define IXGBE_ESP_FEATURES (NETIF_F_HW_ESP | \ > NETIF_F_HW_ESP_TX_CSUM | \ > NETIF_F_GSO_ESP) > diff --git a/net/xfrm/Kconfig b/net/xfrm/Kconfig > index 4a9ee2d83158..140270a13d54 100644 > --- a/net/xfrm/Kconfig > +++ b/net/xfrm/Kconfig > @@ -8,7 +8,6 @@ config XFRM > > config XFRM_OFFLOAD > bool > - depends on XFRM > > config XFRM_ALGO > tristate >