Skip to content

Commit d565fa4

Browse files
Gerd Bayerdavem330
authored andcommitted
s390/ism: ism driver implies smc protocol
Since commit a72178c ("net/smc: Fix dependency of SMC on ISM") you can build the ism code without selecting the SMC network protocol. That leaves some ism functions be reported as unused. Move these functions under the conditional compile with CONFIG_SMC. Also codify the suggestion to also configure the SMC protocol in ism's Kconfig - but with an "imply" rather than a "select" as SMC depends on other config options and allow for a deliberate decision not to build SMC. Also, mention that in ISM's help. Fixes: a72178c ("net/smc: Fix dependency of SMC on ISM") Reported-by: Randy Dunlap <[email protected]> Closes: https://lore.kernel.org/netdev/[email protected]/ Signed-off-by: Gerd Bayer <[email protected]> Reviewed-by: Wenjia Zhang <[email protected]> Reviewed-by: Simon Horman <[email protected]> Acked-by: Randy Dunlap <[email protected]> Tested-by: Randy Dunlap <[email protected]> # build-tested Signed-off-by: David S. Miller <[email protected]>
1 parent 0c3bd08 commit d565fa4

File tree

2 files changed

+48
-48
lines changed

2 files changed

+48
-48
lines changed

drivers/s390/net/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ config CCWGROUP
103103
config ISM
104104
tristate "Support for ISM vPCI Adapter"
105105
depends on PCI
106+
imply SMC
106107
default n
107108
help
108109
Select this option if you want to use the Internal Shared Memory
109-
vPCI Adapter.
110+
vPCI Adapter. The adapter can be used with the SMC network protocol.
110111

111112
To compile as a module choose M. The module name is ism.
112113
If unsure, choose N.

drivers/s390/net/ism_drv.c

Lines changed: 46 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ static const struct pci_device_id ism_device_table[] = {
3030
MODULE_DEVICE_TABLE(pci, ism_device_table);
3131

3232
static debug_info_t *ism_debug_info;
33-
static const struct smcd_ops ism_ops;
3433

3534
#define NO_CLIENT 0xff /* must be >= MAX_CLIENTS */
3635
static struct ism_client *clients[MAX_CLIENTS]; /* use an array rather than */
@@ -289,22 +288,6 @@ static int ism_read_local_gid(struct ism_dev *ism)
289288
return ret;
290289
}
291290

292-
static int ism_query_rgid(struct ism_dev *ism, u64 rgid, u32 vid_valid,
293-
u32 vid)
294-
{
295-
union ism_query_rgid cmd;
296-
297-
memset(&cmd, 0, sizeof(cmd));
298-
cmd.request.hdr.cmd = ISM_QUERY_RGID;
299-
cmd.request.hdr.len = sizeof(cmd.request);
300-
301-
cmd.request.rgid = rgid;
302-
cmd.request.vlan_valid = vid_valid;
303-
cmd.request.vlan_id = vid;
304-
305-
return ism_cmd(ism, &cmd);
306-
}
307-
308291
static void ism_free_dmb(struct ism_dev *ism, struct ism_dmb *dmb)
309292
{
310293
clear_bit(dmb->sba_idx, ism->sba_bitmap);
@@ -429,23 +412,6 @@ static int ism_del_vlan_id(struct ism_dev *ism, u64 vlan_id)
429412
return ism_cmd(ism, &cmd);
430413
}
431414

432-
static int ism_signal_ieq(struct ism_dev *ism, u64 rgid, u32 trigger_irq,
433-
u32 event_code, u64 info)
434-
{
435-
union ism_sig_ieq cmd;
436-
437-
memset(&cmd, 0, sizeof(cmd));
438-
cmd.request.hdr.cmd = ISM_SIGNAL_IEQ;
439-
cmd.request.hdr.len = sizeof(cmd.request);
440-
441-
cmd.request.rgid = rgid;
442-
cmd.request.trigger_irq = trigger_irq;
443-
cmd.request.event_code = event_code;
444-
cmd.request.info = info;
445-
446-
return ism_cmd(ism, &cmd);
447-
}
448-
449415
static unsigned int max_bytes(unsigned int start, unsigned int len,
450416
unsigned int boundary)
451417
{
@@ -503,14 +469,6 @@ u8 *ism_get_seid(void)
503469
}
504470
EXPORT_SYMBOL_GPL(ism_get_seid);
505471

506-
static u16 ism_get_chid(struct ism_dev *ism)
507-
{
508-
if (!ism || !ism->pdev)
509-
return 0;
510-
511-
return to_zpci(ism->pdev)->pchid;
512-
}
513-
514472
static void ism_handle_event(struct ism_dev *ism)
515473
{
516474
struct ism_event *entry;
@@ -569,11 +527,6 @@ static irqreturn_t ism_handle_irq(int irq, void *data)
569527
return IRQ_HANDLED;
570528
}
571529

572-
static u64 ism_get_local_gid(struct ism_dev *ism)
573-
{
574-
return ism->local_gid;
575-
}
576-
577530
static int ism_dev_init(struct ism_dev *ism)
578531
{
579532
struct pci_dev *pdev = ism->pdev;
@@ -774,6 +727,22 @@ module_exit(ism_exit);
774727
/*************************** SMC-D Implementation *****************************/
775728

776729
#if IS_ENABLED(CONFIG_SMC)
730+
static int ism_query_rgid(struct ism_dev *ism, u64 rgid, u32 vid_valid,
731+
u32 vid)
732+
{
733+
union ism_query_rgid cmd;
734+
735+
memset(&cmd, 0, sizeof(cmd));
736+
cmd.request.hdr.cmd = ISM_QUERY_RGID;
737+
cmd.request.hdr.len = sizeof(cmd.request);
738+
739+
cmd.request.rgid = rgid;
740+
cmd.request.vlan_valid = vid_valid;
741+
cmd.request.vlan_id = vid;
742+
743+
return ism_cmd(ism, &cmd);
744+
}
745+
777746
static int smcd_query_rgid(struct smcd_dev *smcd, u64 rgid, u32 vid_valid,
778747
u32 vid)
779748
{
@@ -811,6 +780,23 @@ static int smcd_reset_vlan_required(struct smcd_dev *smcd)
811780
return ism_cmd_simple(smcd->priv, ISM_RESET_VLAN);
812781
}
813782

783+
static int ism_signal_ieq(struct ism_dev *ism, u64 rgid, u32 trigger_irq,
784+
u32 event_code, u64 info)
785+
{
786+
union ism_sig_ieq cmd;
787+
788+
memset(&cmd, 0, sizeof(cmd));
789+
cmd.request.hdr.cmd = ISM_SIGNAL_IEQ;
790+
cmd.request.hdr.len = sizeof(cmd.request);
791+
792+
cmd.request.rgid = rgid;
793+
cmd.request.trigger_irq = trigger_irq;
794+
cmd.request.event_code = event_code;
795+
cmd.request.info = info;
796+
797+
return ism_cmd(ism, &cmd);
798+
}
799+
814800
static int smcd_signal_ieq(struct smcd_dev *smcd, u64 rgid, u32 trigger_irq,
815801
u32 event_code, u64 info)
816802
{
@@ -830,11 +816,24 @@ static int smcd_supports_v2(void)
830816
SYSTEM_EID.type[0] != '0';
831817
}
832818

819+
static u64 ism_get_local_gid(struct ism_dev *ism)
820+
{
821+
return ism->local_gid;
822+
}
823+
833824
static u64 smcd_get_local_gid(struct smcd_dev *smcd)
834825
{
835826
return ism_get_local_gid(smcd->priv);
836827
}
837828

829+
static u16 ism_get_chid(struct ism_dev *ism)
830+
{
831+
if (!ism || !ism->pdev)
832+
return 0;
833+
834+
return to_zpci(ism->pdev)->pchid;
835+
}
836+
838837
static u16 smcd_get_chid(struct smcd_dev *smcd)
839838
{
840839
return ism_get_chid(smcd->priv);

0 commit comments

Comments
 (0)