Skip to content

Commit

Permalink
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/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]>
  • Loading branch information
kuba-moo committed Mar 15, 2022
2 parents abe2fec + 1261691 commit c84d86a
Show file tree
Hide file tree
Showing 23 changed files with 7,563 additions and 7,509 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/intel/ice/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ ice-y := ice_main.o \
ice-$(CONFIG_PCI_IOV) += \
ice_virtchnl_allowlist.o \
ice_virtchnl_fdir.o \
ice_sriov.o \
ice_vf_mbx.o \
ice_vf_vsi_vlan_ops.o \
ice_virtchnl_pf.o
ice_sriov.o
ice-$(CONFIG_PTP_1588_CLOCK) += ice_ptp.o ice_ptp_hw.o
ice-$(CONFIG_TTY) += ice_gnss.o
ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_nl.o ice_dcb_lib.o
Expand Down
5 changes: 1 addition & 4 deletions drivers/net/ethernet/intel/ice/ice.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@
#include <net/udp_tunnel.h>
#include <net/vxlan.h>
#include <net/gtp.h>
#if IS_ENABLED(CONFIG_DCB)
#include <scsi/iscsi_proto.h>
#endif /* CONFIG_DCB */
#include "ice_devids.h"
#include "ice_type.h"
#include "ice_txrx.h"
Expand All @@ -64,8 +61,8 @@
#include "ice_flow.h"
#include "ice_sched.h"
#include "ice_idc_int.h"
#include "ice_virtchnl_pf.h"
#include "ice_sriov.h"
#include "ice_vf_mbx.h"
#include "ice_ptp.h"
#include "ice_fdir.h"
#include "ice_xsk.h"
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/ethernet/intel/ice/ice_arfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

#ifndef _ICE_ARFS_H_
#define _ICE_ARFS_H_

#include "ice_fdir.h"

enum ice_arfs_fltr_state {
ICE_ARFS_INACTIVE,
ICE_ARFS_ACTIVE,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/ice/ice_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "ice_base.h"
#include "ice_lib.h"
#include "ice_dcb_lib.h"
#include "ice_virtchnl_pf.h"
#include "ice_sriov.h"

static bool ice_alloc_rx_buf_zc(struct ice_rx_ring *rx_ring)
{
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/intel/ice/ice_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

#include <linux/bitfield.h>

#include "ice.h"
#include "ice_type.h"
#include "ice_nvm.h"
#include "ice_flex_pipe.h"
#include "ice_switch.h"
#include <linux/avf/virtchnl.h>
#include "ice_switch.h"
#include "ice_fdir.h"

#define ICE_SQ_SEND_DELAY_TIME_MS 10
#define ICE_SQ_SEND_MAX_EXECUTE 3
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/intel/ice/ice_dcb.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#define _ICE_DCB_H_

#include "ice_type.h"
#include <scsi/iscsi_proto.h>

#define ICE_DCBX_STATUS_NOT_STARTED 0
#define ICE_DCBX_STATUS_IN_PROGRESS 1
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/intel/ice/ice_flex_pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "ice_common.h"
#include "ice_flex_pipe.h"
#include "ice_flow.h"
#include "ice.h"

/* For supporting double VLAN mode, it is necessary to enable or disable certain
* boost tcam entries. The metadata labels names that match the following
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/intel/ice/ice_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "ice_common.h"
#include "ice_flow.h"
#include <net/gre.h>

/* Describe properties of a protocol header field */
struct ice_flow_field_info {
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/intel/ice/ice_flow.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#ifndef _ICE_FLOW_H_
#define _ICE_FLOW_H_

#include "ice_flex_type.h"

#define ICE_FLOW_ENTRY_HANDLE_INVAL 0
#define ICE_FLOW_FLD_OFF_INVAL 0xffff

Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/ice/ice_idc_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#define _ICE_IDC_INT_H_

#include <linux/net/intel/iidc.h>
#include "ice.h"

struct ice_pf;

Expand Down
17 changes: 16 additions & 1 deletion drivers/net/ethernet/intel/ice/ice_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ static DEFINE_IDA(ice_aux_ida);
DEFINE_STATIC_KEY_FALSE(ice_xdp_locking_key);
EXPORT_SYMBOL(ice_xdp_locking_key);

/**
* ice_hw_to_dev - Get device pointer from the hardware structure
* @hw: pointer to the device HW structure
*
* Used to access the device pointer from compilation units which can't easily
* include the definition of struct ice_pf without leading to circular header
* dependencies.
*/
struct device *ice_hw_to_dev(struct ice_hw *hw)
{
struct ice_pf *pf = container_of(hw, struct ice_pf, hw);

return &pf->pdev->dev;
}

static struct workqueue_struct *ice_wq;
static const struct net_device_ops ice_netdev_safe_mode_ops;
static const struct net_device_ops ice_netdev_ops;
Expand Down Expand Up @@ -3739,7 +3754,7 @@ static void ice_set_pf_caps(struct ice_pf *pf)
if (func_caps->common_cap.sr_iov_1_1) {
set_bit(ICE_FLAG_SRIOV_CAPABLE, pf->flags);
pf->vfs.num_supported = min_t(int, func_caps->num_allocd_vfs,
ICE_MAX_VF_COUNT);
ICE_MAX_SRIOV_VFS);
}
clear_bit(ICE_FLAG_RSS_ENA, pf->flags);
if (func_caps->common_cap.rss_table_size)
Expand Down
11 changes: 9 additions & 2 deletions drivers/net/ethernet/intel/ice/ice_osdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
#define _ICE_OSDEP_H_

#include <linux/types.h>
#include <linux/ctype.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/bitops.h>
#include <linux/ethtool.h>
#include <linux/etherdevice.h>
#include <linux/if_ether.h>
#include <linux/pci_ids.h>
#ifndef CONFIG_64BIT
#include <linux/io-64-nonatomic-lo-hi.h>
#endif
Expand All @@ -25,8 +32,8 @@ struct ice_dma_mem {
size_t size;
};

#define ice_hw_to_dev(ptr) \
(&(container_of((ptr), struct ice_pf, hw))->pdev->dev)
struct ice_hw;
struct device *ice_hw_to_dev(struct ice_hw *hw);

#ifdef CONFIG_DYNAMIC_DEBUG
#define ice_debug(hw, type, fmt, args...) \
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/ethernet/intel/ice/ice_repr.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "ice.h"
#include "ice_eswitch.h"
#include "ice_devlink.h"
#include "ice_virtchnl_pf.h"
#include "ice_sriov.h"
#include "ice_tc_lib.h"

/**
Expand Down Expand Up @@ -339,7 +339,7 @@ static int ice_repr_add(struct ice_vf *vf)

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

ice_vc_change_ops_to_repr(&vf->vc_ops);
ice_virtchnl_set_repr_ops(vf);

return 0;

Expand Down Expand Up @@ -384,7 +384,7 @@ static void ice_repr_rem(struct ice_vf *vf)
kfree(vf->repr);
vf->repr = NULL;

ice_vc_set_dflt_vf_ops(&vf->vc_ops);
ice_virtchnl_set_dflt_ops(vf);
}

/**
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/intel/ice/ice_repr.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#define _ICE_REPR_H_

#include <net/dst_metadata.h>
#include "ice.h"

struct ice_repr {
struct ice_vsi *src_vsi;
Expand Down
Loading

0 comments on commit c84d86a

Please sign in to comment.