Commit 3b8f56ee authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch '100GbE-Intel-Wired-LAN-Driver-Updates-2020-10-07'



Tony Nguyen says:

====================
100GbE Intel Wired LAN Driver Updates 2020-10-07

This series contains updates to ice driver only.

Andy Shevchenko changes usage to %*phD format to print small buffer as hex
string.

Bruce removes repeated words reported by checkpatch.

Ani changes ice_info_get_dsn() to return void as it always returns
success.

Jake adds devlink reporting of fw.app.bundle_id. Moves devlink_port
structure to ice_vsi to resolve issues with cleanup. Adds additional
debug info for firmware updates.

Bixuan Cui resolves -Wpointer-to-int-cast warnings.

Dan adds additional packet type masks and checks to prevent overwriting
existing Flow Director rules.
====================

Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 5d3b8ec9 051d2b5c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -69,6 +69,11 @@ The ``ice`` driver reports the following versions
      - The version of the DDP package that is active in the device. Note
        that both the name (as reported by ``fw.app.name``) and version are
        required to uniquely identify the package.
    * - ``fw.app.bundle_id``
      - 0xc0000001
      - Unique identifier for the DDP package loaded in the device. Also
        referred to as the DDP Track ID. Can be used to uniquely identify
        the specific DDP package.
    * - ``fw.netlist``
      - running
      - 1.1.2000-6.7.0
+4 −3
Original line number Diff line number Diff line
@@ -284,6 +284,10 @@ struct ice_vsi {
	spinlock_t arfs_lock;	/* protects aRFS hash table and filter state */
	atomic_t *arfs_last_fltr_id;

	/* devlink port data */
	struct devlink_port devlink_port;
	bool devlink_port_registered;

	u16 max_frame;
	u16 rx_buf_len;

@@ -375,9 +379,6 @@ enum ice_pf_flags {
struct ice_pf {
	struct pci_dev *pdev;

	/* devlink port data */
	struct devlink_port devlink_port;

	struct devlink_region *nvm_region;
	struct devlink_region *devcaps_region;

+45 −33
Original line number Diff line number Diff line
@@ -6,18 +6,14 @@
#include "ice_devlink.h"
#include "ice_fw_update.h"

static int ice_info_get_dsn(struct ice_pf *pf, char *buf, size_t len)
static void ice_info_get_dsn(struct ice_pf *pf, char *buf, size_t len)
{
	u8 dsn[8];

	/* Copy the DSN into an array in Big Endian format */
	put_unaligned_be64(pci_get_dsn(pf->pdev), dsn);

	snprintf(buf, len, "%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x",
		 dsn[0], dsn[1], dsn[2], dsn[3],
		 dsn[4], dsn[5], dsn[6], dsn[7]);

	return 0;
	snprintf(buf, len, "%8phD", dsn);
}

static int ice_info_pba(struct ice_pf *pf, char *buf, size_t len)
@@ -106,6 +102,13 @@ static int ice_info_ddp_pkg_version(struct ice_pf *pf, char *buf, size_t len)
	return 0;
}

static int ice_info_ddp_pkg_bundle_id(struct ice_pf *pf, char *buf, size_t len)
{
	snprintf(buf, len, "0x%08x", pf->hw.active_track_id);

	return 0;
}

static int ice_info_netlist_ver(struct ice_pf *pf, char *buf, size_t len)
{
	struct ice_netlist_ver_info *netlist = &pf->hw.netlist_ver;
@@ -150,6 +153,7 @@ static const struct ice_devlink_version {
	running(DEVLINK_INFO_VERSION_GENERIC_FW_BUNDLE_ID, ice_info_eetrack),
	running("fw.app.name", ice_info_ddp_pkg_name),
	running(DEVLINK_INFO_VERSION_GENERIC_FW_APP, ice_info_ddp_pkg_version),
	running("fw.app.bundle_id", ice_info_ddp_pkg_bundle_id),
	running("fw.netlist", ice_info_netlist_ver),
	running("fw.netlist.build", ice_info_netlist_build),
};
@@ -180,11 +184,7 @@ static int ice_devlink_info_get(struct devlink *devlink,
		return err;
	}

	err = ice_info_get_dsn(pf, buf, sizeof(buf));
	if (err) {
		NL_SET_ERR_MSG_MOD(extack, "Unable to obtain serial number");
		return err;
	}
	ice_info_get_dsn(pf, buf, sizeof(buf));

	err = devlink_info_serial_number_put(req, buf);
	if (err) {
@@ -283,6 +283,8 @@ ice_devlink_flash_update(struct devlink *devlink,
		return err;
	}

	dev_dbg(dev, "Beginning flash update with file '%s'\n", params->file_name);

	devlink_flash_update_begin_notify(devlink);
	devlink_flash_update_status_notify(devlink, "Preparing to flash", NULL, 0, 0);
	err = ice_flash_pldm_image(pf, fw, preservation, extack);
@@ -364,50 +366,60 @@ void ice_devlink_unregister(struct ice_pf *pf)
}

/**
 * ice_devlink_create_port - Create a devlink port for this PF
 * @pf: the PF to create a port for
 * ice_devlink_create_port - Create a devlink port for this VSI
 * @vsi: the VSI to create a port for
 *
 * Create and register a devlink_port for this PF. Note that although each
 * physical function is connected to a separate devlink instance, the port
 * will still be numbered according to the physical function ID.
 * Create and register a devlink_port for this VSI.
 *
 * Return: zero on success or an error code on failure.
 */
int ice_devlink_create_port(struct ice_pf *pf)
int ice_devlink_create_port(struct ice_vsi *vsi)
{
	struct devlink *devlink = priv_to_devlink(pf);
	struct ice_vsi *vsi = ice_get_main_vsi(pf);
	struct device *dev = ice_pf_to_dev(pf);
	struct devlink_port_attrs attrs = {};
	struct ice_port_info *pi;
	struct devlink *devlink;
	struct device *dev;
	struct ice_pf *pf;
	int err;

	if (!vsi) {
		dev_err(dev, "%s: unable to find main VSI\n", __func__);
		return -EIO;
	}
	/* Currently we only create devlink_port instances for PF VSIs */
	if (vsi->type != ICE_VSI_PF)
		return -EINVAL;

	pf = vsi->back;
	devlink = priv_to_devlink(pf);
	dev = ice_pf_to_dev(pf);
	pi = pf->hw.port_info;

	attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL;
	attrs.phys.port_number = pf->hw.pf_id;
	devlink_port_attrs_set(&pf->devlink_port, &attrs);
	err = devlink_port_register(devlink, &pf->devlink_port, pf->hw.pf_id);
	attrs.phys.port_number = pi->lport;
	devlink_port_attrs_set(&vsi->devlink_port, &attrs);
	err = devlink_port_register(devlink, &vsi->devlink_port, vsi->idx);
	if (err) {
		dev_err(dev, "devlink_port_register failed: %d\n", err);
		return err;
	}

	vsi->devlink_port_registered = true;

	return 0;
}

/**
 * ice_devlink_destroy_port - Destroy the devlink_port for this PF
 * @pf: the PF to cleanup
 * ice_devlink_destroy_port - Destroy the devlink_port for this VSI
 * @vsi: the VSI to cleanup
 *
 * Unregisters the devlink_port structure associated with this PF.
 * Unregisters the devlink_port structure associated with this VSI.
 */
void ice_devlink_destroy_port(struct ice_pf *pf)
void ice_devlink_destroy_port(struct ice_vsi *vsi)
{
	devlink_port_type_clear(&pf->devlink_port);
	devlink_port_unregister(&pf->devlink_port);
	if (!vsi->devlink_port_registered)
		return;

	devlink_port_type_clear(&vsi->devlink_port);
	devlink_port_unregister(&vsi->devlink_port);

	vsi->devlink_port_registered = false;
}

/**
+2 −2
Original line number Diff line number Diff line
@@ -8,8 +8,8 @@ struct ice_pf *ice_allocate_pf(struct device *dev);

int ice_devlink_register(struct ice_pf *pf);
void ice_devlink_unregister(struct ice_pf *pf);
int ice_devlink_create_port(struct ice_pf *pf);
void ice_devlink_destroy_port(struct ice_pf *pf);
int ice_devlink_create_port(struct ice_vsi *vsi);
void ice_devlink_destroy_port(struct ice_vsi *vsi);

void ice_devlink_init_regions(struct ice_pf *pf);
void ice_devlink_destroy_regions(struct ice_pf *pf);
+1 −1
Original line number Diff line number Diff line
@@ -4876,7 +4876,7 @@ ice_rem_prof_id_flow(struct ice_hw *hw, enum ice_block blk, u16 vsi, u64 hdl)

			if (last_profile) {
				/* If there are no profiles left for this VSIG,
				 * then simply remove the the VSIG.
				 * then simply remove the VSIG.
				 */
				status = ice_rem_vsig(hw, blk, vsig, &chg);
				if (status)
Loading