[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZeBKgpUurx90HDET@nanopsycho>
Date: Thu, 29 Feb 2024 10:12:34 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Larysa Zaremba <larysa.zaremba@...el.com>
Cc: intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Mateusz Pacuszka <mateuszx.pacuszka@...el.com>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
Lukasz Plachno <lukasz.plachno@...el.com>,
Jakub Buchocki <jakubx.buchocki@...el.com>,
Pawel Kaminski <pawel.kaminski@...el.com>,
Przemek Kitszel <przemyslaw.kitszel@...el.com>,
Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>,
Mateusz Polchlopek <mateusz.polchlopek@...el.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Pawel Chmielewski <pawel.chmielewski@...el.com>,
Jesse Brandeburg <jesse.brandeburg@...el.com>
Subject: Re: [PATCH iwl-net 4/5] ice: Implement VF LLDP RX support on VF
Wed, Feb 28, 2024 at 04:59:48PM CET, larysa.zaremba@...el.com wrote:
[...]
>diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
>index 9c2c8637b4a7..af3611055e60 100644
>--- a/drivers/net/ethernet/intel/ice/ice_main.c
>+++ b/drivers/net/ethernet/intel/ice/ice_main.c
>@@ -4704,9 +4704,60 @@ void ice_deinit_dev(struct ice_pf *pf)
> ice_clear_interrupt_scheme(pf);
> }
>
>+static ssize_t rx_lldp_show(struct device *dev, struct device_attribute *attr,
>+ char *buf)
>+{
>+ struct ice_pf *pf = dev_get_drvdata(dev);
>+ struct ice_vsi *vsi = ice_get_main_vsi(pf);
>+
>+ return sysfs_emit(buf, "%u\n", vsi->rx_lldp_ena);
>+}
>+
>+static ssize_t rx_lldp_store(struct device *dev, struct device_attribute *attr,
>+ const char *buf, size_t count)
>+{
>+ struct ice_pf *pf = dev_get_drvdata(dev);
>+ struct ice_vsi *vsi;
>+ bool ena;
>+ int err;
>+
>+ if (test_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags)) {
>+ dev_err(dev, "Toggling Rx LLDP for PF is only allowed when FW LLDP Agent is disabled");
>+ return -EPERM;
>+ }
>+
>+ err = kstrtobool(buf, &ena);
>+ if (err)
>+ return -EINVAL;
>+
>+ vsi = ice_get_main_vsi(pf);
>+
>+ if (ena == vsi->rx_lldp_ena) {
>+ dev_dbg(dev, "Rx LLDP already %sabled", ena ? "en" : "dis");
>+ return count;
>+ }
>+
>+ ice_cfg_sw_lldp(vsi, false, ena);
>+
>+ return count;
>+}
>+
>+static DEVICE_ATTR_RW(rx_lldp);
>+
>+static int ice_init_rx_lldp_sysfs(struct ice_pf *pf)
>+{
>+ return device_create_file(ice_pf_to_dev(pf), &dev_attr_rx_lldp);
Don't add driver specific sysfs knobs please.
pw-bot: reject
[...]
Powered by blists - more mailing lists