diff mbox series

[net-queue,v2,1/2] ixgbe: Use CONFIG_XFRM_OFFLOAD instead of CONFIG_XFRM

Message ID 20180604205120.5474.22753.stgit@ahduyck-green-test.jf.intel.com
State Accepted
Delegated to: Jeff Kirsher
Headers show
Series ixgbe: ipsec fixes | expand

Commit Message

Duyck, Alexander H June 4, 2018, 8:51 p.m. UTC
There is no point in adding code if CONFIG_XFRM is defined that we won't
use unless CONFIG_XFRM_OFFLOAD is defined. So instead of leaving this code
floating around I am replacing the ifdef with what I believe is the correct
one so that we only include the code and variables if they will actually be
used.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe.h      |    4 ++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Shannon Nelson June 4, 2018, 9:13 p.m. UTC | #1
On 6/4/2018 1:51 PM, Alexander Duyck wrote:
> There is no point in adding code if CONFIG_XFRM is defined that we won't
> use unless CONFIG_XFRM_OFFLOAD is defined. So instead of leaving this code
> floating around I am replacing the ifdef with what I believe is the correct
> one so that we only include the code and variables if they will actually be
> used.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>

Acked-by: Shannon Nelson <shannon.nelson@oracle.com>

> ---
>   drivers/net/ethernet/intel/ixgbe/ixgbe.h      |    4 ++--
>   drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |    2 +-
>   2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
> index fc534e9..144d5fe 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
> @@ -760,9 +760,9 @@ struct ixgbe_adapter {
>   #define IXGBE_RSS_KEY_SIZE     40  /* size of RSS Hash Key in bytes */
>   	u32 *rss_key;
>   
> -#ifdef CONFIG_XFRM
> +#ifdef CONFIG_XFRM_OFFLOAD
>   	struct ixgbe_ipsec *ipsec;
> -#endif /* CONFIG_XFRM */
> +#endif /* CONFIG_XFRM_OFFLOAD */
>   };
>   
>   static inline u8 ixgbe_max_rss_indices(struct ixgbe_adapter *adapter)
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index 6d20295..8cab0c5 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -9945,7 +9945,7 @@ static void ixgbe_fwd_del(struct net_device *pdev, void *priv)
>   	 * the TSO, so it's the exception.
>   	 */
>   	if (skb->encapsulation && !(features & NETIF_F_TSO_MANGLEID)) {
> -#ifdef CONFIG_XFRM
> +#ifdef CONFIG_XFRM_OFFLOAD
>   		if (!skb->sp)
>   #endif
>   			features &= ~NETIF_F_TSO;
>
Bowers, AndrewX June 6, 2018, 4:20 p.m. UTC | #2
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On
> Behalf Of Shannon Nelson
> Sent: Monday, June 4, 2018 2:13 PM
> To: Duyck, Alexander H <alexander.h.duyck@intel.com>; intel-wired-
> lan@osuosl.org; andre@tomt.net
> Subject: Re: [Intel-wired-lan] [net-queue PATCH v2 1/2] ixgbe: Use
> CONFIG_XFRM_OFFLOAD instead of CONFIG_XFRM
> 
> On 6/4/2018 1:51 PM, Alexander Duyck wrote:
> > There is no point in adding code if CONFIG_XFRM is defined that we
> > won't use unless CONFIG_XFRM_OFFLOAD is defined. So instead of leaving
> > this code floating around I am replacing the ifdef with what I believe
> > is the correct one so that we only include the code and variables if
> > they will actually be used.
> >
> > Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> 
> Acked-by: Shannon Nelson <shannon.nelson@oracle.com>
> 
> > ---
> >   drivers/net/ethernet/intel/ixgbe/ixgbe.h      |    4 ++--
> >   drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |    2 +-
> >   2 files changed, 3 insertions(+), 3 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index fc534e9..144d5fe 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -760,9 +760,9 @@  struct ixgbe_adapter {
 #define IXGBE_RSS_KEY_SIZE     40  /* size of RSS Hash Key in bytes */
 	u32 *rss_key;
 
-#ifdef CONFIG_XFRM
+#ifdef CONFIG_XFRM_OFFLOAD
 	struct ixgbe_ipsec *ipsec;
-#endif /* CONFIG_XFRM */
+#endif /* CONFIG_XFRM_OFFLOAD */
 };
 
 static inline u8 ixgbe_max_rss_indices(struct ixgbe_adapter *adapter)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 6d20295..8cab0c5 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -9945,7 +9945,7 @@  static void ixgbe_fwd_del(struct net_device *pdev, void *priv)
 	 * the TSO, so it's the exception.
 	 */
 	if (skb->encapsulation && !(features & NETIF_F_TSO_MANGLEID)) {
-#ifdef CONFIG_XFRM
+#ifdef CONFIG_XFRM_OFFLOAD
 		if (!skb->sp)
 #endif
 			features &= ~NETIF_F_TSO;