Skip to content

Commit c84d86a

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2022-03-14 Jacob Keller says: The ice_virtchnl_pf.c file has become a single place for a lot of virtualization functionality. This includes most of the virtchnl message handling, integration with kernel hooks like the .ndo operations, reset logic, and more. We are planning in the future to implement and support Scalable IOV in the ice driver. To do this, much (but not all) of the code in ice_virtchnl_pf.c will want to be reused. Rather than dump all of the Scalable IOV implementation into ice_virtchnl_pf.c it makes sense to house it in a separate file. But that still leaves all of the Single Root IOV code littered among more generic logic. The long term goal is to re-organize the code such that generic re-usable code is split into separate files. The ice_sriov.c file would end up containing all of the Single Root IOV implementation specific details, while ice_vf_lib.[ch] and ice_virtchnl.[ch] contain the generic pieces. As a first step, notice that ice_sriov.c currently does not contain much of the SR-IOV implementation. This is housed primarily in ice_virtchnl_pf.c The code in ice_sriov.c is really generic and relates to the VF mailbox, including mailbox overflow detection. Rename ice_sriov.c to ice_vf_mbx.c, and then rename ice_virtchnl_pf.c to ice_sriov.c A later series will finish the refactor by splitting ice_sriov.c into multiple files, moving the generic code into ice_vf_lib.c and ice_virtchnl.c To prepare for that series, perform some basic cleanup and other refactors that we've accumulated during this development cycle. This series builds on top of the recent hash table refactor work. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: ice: use ice_is_vf_trusted helper function ice: log an error message when eswitch fails to configure ice: cleanup error logging for ice_ena_vfs ice: move ice_set_vf_port_vlan near other .ndo ops ice: refactor spoofchk control code in ice_sriov.c ice: rename ICE_MAX_VF_COUNT to avoid confusion ice: remove unused definitions from ice_sriov.h ice: convert vf->vc_ops to a const pointer ice: remove circular header dependencies on ice.h ice: rename ice_virtchnl_pf.c to ice_sriov.c ice: rename ice_sriov.c to ice_vf_mbx.c ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents abe2fec + 1261691 commit c84d86a

23 files changed

+7563
-7509
lines changed

drivers/net/ethernet/intel/ice/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ ice-y := ice_main.o \
3636
ice-$(CONFIG_PCI_IOV) += \
3737
ice_virtchnl_allowlist.o \
3838
ice_virtchnl_fdir.o \
39-
ice_sriov.o \
39+
ice_vf_mbx.o \
4040
ice_vf_vsi_vlan_ops.o \
41-
ice_virtchnl_pf.o
41+
ice_sriov.o
4242
ice-$(CONFIG_PTP_1588_CLOCK) += ice_ptp.o ice_ptp_hw.o
4343
ice-$(CONFIG_TTY) += ice_gnss.o
4444
ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_nl.o ice_dcb_lib.o

drivers/net/ethernet/intel/ice/ice.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@
5252
#include <net/udp_tunnel.h>
5353
#include <net/vxlan.h>
5454
#include <net/gtp.h>
55-
#if IS_ENABLED(CONFIG_DCB)
56-
#include <scsi/iscsi_proto.h>
57-
#endif /* CONFIG_DCB */
5855
#include "ice_devids.h"
5956
#include "ice_type.h"
6057
#include "ice_txrx.h"
@@ -64,8 +61,8 @@
6461
#include "ice_flow.h"
6562
#include "ice_sched.h"
6663
#include "ice_idc_int.h"
67-
#include "ice_virtchnl_pf.h"
6864
#include "ice_sriov.h"
65+
#include "ice_vf_mbx.h"
6966
#include "ice_ptp.h"
7067
#include "ice_fdir.h"
7168
#include "ice_xsk.h"

drivers/net/ethernet/intel/ice/ice_arfs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
#ifndef _ICE_ARFS_H_
55
#define _ICE_ARFS_H_
6+
7+
#include "ice_fdir.h"
8+
69
enum ice_arfs_fltr_state {
710
ICE_ARFS_INACTIVE,
811
ICE_ARFS_ACTIVE,

drivers/net/ethernet/intel/ice/ice_base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "ice_base.h"
66
#include "ice_lib.h"
77
#include "ice_dcb_lib.h"
8-
#include "ice_virtchnl_pf.h"
8+
#include "ice_sriov.h"
99

1010
static bool ice_alloc_rx_buf_zc(struct ice_rx_ring *rx_ring)
1111
{

drivers/net/ethernet/intel/ice/ice_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
#include <linux/bitfield.h>
88

9-
#include "ice.h"
109
#include "ice_type.h"
1110
#include "ice_nvm.h"
1211
#include "ice_flex_pipe.h"
13-
#include "ice_switch.h"
1412
#include <linux/avf/virtchnl.h>
13+
#include "ice_switch.h"
14+
#include "ice_fdir.h"
1515

1616
#define ICE_SQ_SEND_DELAY_TIME_MS 10
1717
#define ICE_SQ_SEND_MAX_EXECUTE 3

drivers/net/ethernet/intel/ice/ice_dcb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#define _ICE_DCB_H_
66

77
#include "ice_type.h"
8+
#include <scsi/iscsi_proto.h>
89

910
#define ICE_DCBX_STATUS_NOT_STARTED 0
1011
#define ICE_DCBX_STATUS_IN_PROGRESS 1

drivers/net/ethernet/intel/ice/ice_flex_pipe.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "ice_common.h"
55
#include "ice_flex_pipe.h"
66
#include "ice_flow.h"
7+
#include "ice.h"
78

89
/* For supporting double VLAN mode, it is necessary to enable or disable certain
910
* boost tcam entries. The metadata labels names that match the following

drivers/net/ethernet/intel/ice/ice_flow.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "ice_common.h"
55
#include "ice_flow.h"
6+
#include <net/gre.h>
67

78
/* Describe properties of a protocol header field */
89
struct ice_flow_field_info {

drivers/net/ethernet/intel/ice/ice_flow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#ifndef _ICE_FLOW_H_
55
#define _ICE_FLOW_H_
66

7+
#include "ice_flex_type.h"
8+
79
#define ICE_FLOW_ENTRY_HANDLE_INVAL 0
810
#define ICE_FLOW_FLD_OFF_INVAL 0xffff
911

drivers/net/ethernet/intel/ice/ice_idc_int.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#define _ICE_IDC_INT_H_
66

77
#include <linux/net/intel/iidc.h>
8-
#include "ice.h"
98

109
struct ice_pf;
1110

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ static DEFINE_IDA(ice_aux_ida);
4848
DEFINE_STATIC_KEY_FALSE(ice_xdp_locking_key);
4949
EXPORT_SYMBOL(ice_xdp_locking_key);
5050

51+
/**
52+
* ice_hw_to_dev - Get device pointer from the hardware structure
53+
* @hw: pointer to the device HW structure
54+
*
55+
* Used to access the device pointer from compilation units which can't easily
56+
* include the definition of struct ice_pf without leading to circular header
57+
* dependencies.
58+
*/
59+
struct device *ice_hw_to_dev(struct ice_hw *hw)
60+
{
61+
struct ice_pf *pf = container_of(hw, struct ice_pf, hw);
62+
63+
return &pf->pdev->dev;
64+
}
65+
5166
static struct workqueue_struct *ice_wq;
5267
static const struct net_device_ops ice_netdev_safe_mode_ops;
5368
static const struct net_device_ops ice_netdev_ops;
@@ -3739,7 +3754,7 @@ static void ice_set_pf_caps(struct ice_pf *pf)
37393754
if (func_caps->common_cap.sr_iov_1_1) {
37403755
set_bit(ICE_FLAG_SRIOV_CAPABLE, pf->flags);
37413756
pf->vfs.num_supported = min_t(int, func_caps->num_allocd_vfs,
3742-
ICE_MAX_VF_COUNT);
3757+
ICE_MAX_SRIOV_VFS);
37433758
}
37443759
clear_bit(ICE_FLAG_RSS_ENA, pf->flags);
37453760
if (func_caps->common_cap.rss_table_size)

drivers/net/ethernet/intel/ice/ice_osdep.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
#define _ICE_OSDEP_H_
66

77
#include <linux/types.h>
8+
#include <linux/ctype.h>
9+
#include <linux/delay.h>
810
#include <linux/io.h>
11+
#include <linux/bitops.h>
12+
#include <linux/ethtool.h>
13+
#include <linux/etherdevice.h>
14+
#include <linux/if_ether.h>
15+
#include <linux/pci_ids.h>
916
#ifndef CONFIG_64BIT
1017
#include <linux/io-64-nonatomic-lo-hi.h>
1118
#endif
@@ -25,8 +32,8 @@ struct ice_dma_mem {
2532
size_t size;
2633
};
2734

28-
#define ice_hw_to_dev(ptr) \
29-
(&(container_of((ptr), struct ice_pf, hw))->pdev->dev)
35+
struct ice_hw;
36+
struct device *ice_hw_to_dev(struct ice_hw *hw);
3037

3138
#ifdef CONFIG_DYNAMIC_DEBUG
3239
#define ice_debug(hw, type, fmt, args...) \

drivers/net/ethernet/intel/ice/ice_repr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "ice.h"
55
#include "ice_eswitch.h"
66
#include "ice_devlink.h"
7-
#include "ice_virtchnl_pf.h"
7+
#include "ice_sriov.h"
88
#include "ice_tc_lib.h"
99

1010
/**
@@ -339,7 +339,7 @@ static int ice_repr_add(struct ice_vf *vf)
339339

340340
devlink_port_type_eth_set(&vf->devlink_port, repr->netdev);
341341

342-
ice_vc_change_ops_to_repr(&vf->vc_ops);
342+
ice_virtchnl_set_repr_ops(vf);
343343

344344
return 0;
345345

@@ -384,7 +384,7 @@ static void ice_repr_rem(struct ice_vf *vf)
384384
kfree(vf->repr);
385385
vf->repr = NULL;
386386

387-
ice_vc_set_dflt_vf_ops(&vf->vc_ops);
387+
ice_virtchnl_set_dflt_ops(vf);
388388
}
389389

390390
/**

drivers/net/ethernet/intel/ice/ice_repr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#define _ICE_REPR_H_
66

77
#include <net/dst_metadata.h>
8-
#include "ice.h"
98

109
struct ice_repr {
1110
struct ice_vsi *src_vsi;

0 commit comments

Comments
 (0)