Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/ism: ism driver implies smc protocol

Since commit a72178cfe855 ("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: a72178cfe855 ("net/smc: Fix dependency of SMC on ISM")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Closes: https://lore.kernel.org/netdev/afd142a2-1fa0-46b9-8b2d-7652d41d3ab8@infradead.org/
Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com>
Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Gerd Bayer and committed by
David S. Miller
d565fa43 0c3bd086

+48 -48
+2 -1
drivers/s390/net/Kconfig
··· 103 103 config ISM 104 104 tristate "Support for ISM vPCI Adapter" 105 105 depends on PCI 106 + imply SMC 106 107 default n 107 108 help 108 109 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. 110 111 111 112 To compile as a module choose M. The module name is ism. 112 113 If unsure, choose N.
+46 -47
drivers/s390/net/ism_drv.c
··· 30 30 MODULE_DEVICE_TABLE(pci, ism_device_table); 31 31 32 32 static debug_info_t *ism_debug_info; 33 - static const struct smcd_ops ism_ops; 34 33 35 34 #define NO_CLIENT 0xff /* must be >= MAX_CLIENTS */ 36 35 static struct ism_client *clients[MAX_CLIENTS]; /* use an array rather than */ ··· 288 289 return ret; 289 290 } 290 291 291 - static int ism_query_rgid(struct ism_dev *ism, u64 rgid, u32 vid_valid, 292 - u32 vid) 293 - { 294 - union ism_query_rgid cmd; 295 - 296 - memset(&cmd, 0, sizeof(cmd)); 297 - cmd.request.hdr.cmd = ISM_QUERY_RGID; 298 - cmd.request.hdr.len = sizeof(cmd.request); 299 - 300 - cmd.request.rgid = rgid; 301 - cmd.request.vlan_valid = vid_valid; 302 - cmd.request.vlan_id = vid; 303 - 304 - return ism_cmd(ism, &cmd); 305 - } 306 - 307 292 static void ism_free_dmb(struct ism_dev *ism, struct ism_dmb *dmb) 308 293 { 309 294 clear_bit(dmb->sba_idx, ism->sba_bitmap); ··· 412 429 return ism_cmd(ism, &cmd); 413 430 } 414 431 415 - static int ism_signal_ieq(struct ism_dev *ism, u64 rgid, u32 trigger_irq, 416 - u32 event_code, u64 info) 417 - { 418 - union ism_sig_ieq cmd; 419 - 420 - memset(&cmd, 0, sizeof(cmd)); 421 - cmd.request.hdr.cmd = ISM_SIGNAL_IEQ; 422 - cmd.request.hdr.len = sizeof(cmd.request); 423 - 424 - cmd.request.rgid = rgid; 425 - cmd.request.trigger_irq = trigger_irq; 426 - cmd.request.event_code = event_code; 427 - cmd.request.info = info; 428 - 429 - return ism_cmd(ism, &cmd); 430 - } 431 - 432 432 static unsigned int max_bytes(unsigned int start, unsigned int len, 433 433 unsigned int boundary) 434 434 { ··· 469 503 } 470 504 EXPORT_SYMBOL_GPL(ism_get_seid); 471 505 472 - static u16 ism_get_chid(struct ism_dev *ism) 473 - { 474 - if (!ism || !ism->pdev) 475 - return 0; 476 - 477 - return to_zpci(ism->pdev)->pchid; 478 - } 479 - 480 506 static void ism_handle_event(struct ism_dev *ism) 481 507 { 482 508 struct ism_event *entry; ··· 525 567 } 526 568 spin_unlock(&ism->lock); 527 569 return IRQ_HANDLED; 528 - } 529 - 530 - static u64 ism_get_local_gid(struct ism_dev *ism) 531 - { 532 - return ism->local_gid; 533 570 } 534 571 535 572 static int ism_dev_init(struct ism_dev *ism) ··· 727 774 /*************************** SMC-D Implementation *****************************/ 728 775 729 776 #if IS_ENABLED(CONFIG_SMC) 777 + static int ism_query_rgid(struct ism_dev *ism, u64 rgid, u32 vid_valid, 778 + u32 vid) 779 + { 780 + union ism_query_rgid cmd; 781 + 782 + memset(&cmd, 0, sizeof(cmd)); 783 + cmd.request.hdr.cmd = ISM_QUERY_RGID; 784 + cmd.request.hdr.len = sizeof(cmd.request); 785 + 786 + cmd.request.rgid = rgid; 787 + cmd.request.vlan_valid = vid_valid; 788 + cmd.request.vlan_id = vid; 789 + 790 + return ism_cmd(ism, &cmd); 791 + } 792 + 730 793 static int smcd_query_rgid(struct smcd_dev *smcd, u64 rgid, u32 vid_valid, 731 794 u32 vid) 732 795 { ··· 780 811 return ism_cmd_simple(smcd->priv, ISM_RESET_VLAN); 781 812 } 782 813 814 + static int ism_signal_ieq(struct ism_dev *ism, u64 rgid, u32 trigger_irq, 815 + u32 event_code, u64 info) 816 + { 817 + union ism_sig_ieq cmd; 818 + 819 + memset(&cmd, 0, sizeof(cmd)); 820 + cmd.request.hdr.cmd = ISM_SIGNAL_IEQ; 821 + cmd.request.hdr.len = sizeof(cmd.request); 822 + 823 + cmd.request.rgid = rgid; 824 + cmd.request.trigger_irq = trigger_irq; 825 + cmd.request.event_code = event_code; 826 + cmd.request.info = info; 827 + 828 + return ism_cmd(ism, &cmd); 829 + } 830 + 783 831 static int smcd_signal_ieq(struct smcd_dev *smcd, u64 rgid, u32 trigger_irq, 784 832 u32 event_code, u64 info) 785 833 { ··· 816 830 SYSTEM_EID.type[0] != '0'; 817 831 } 818 832 833 + static u64 ism_get_local_gid(struct ism_dev *ism) 834 + { 835 + return ism->local_gid; 836 + } 837 + 819 838 static u64 smcd_get_local_gid(struct smcd_dev *smcd) 820 839 { 821 840 return ism_get_local_gid(smcd->priv); 841 + } 842 + 843 + static u16 ism_get_chid(struct ism_dev *ism) 844 + { 845 + if (!ism || !ism->pdev) 846 + return 0; 847 + 848 + return to_zpci(ism->pdev)->pchid; 822 849 } 823 850 824 851 static u16 smcd_get_chid(struct smcd_dev *smcd)