s390: qeth patches
Subsystems (5)
cover s390: qeth patches
Hi Dave,
here are several fixes for the s390 qeth driver, built for net-next.
Thanks,
Ursula
Julian Wiedmann (8):
s390/qeth: Allow reading hsuid from sysfs while card is DOWN s390/qeth: Remove unused define QETH_IP_HEADER_SIZE s390/qeth: drop unused parameter from qeth_l2_del_all_macs() s390/qeth: when setting group MAC, don't convert return code twice s390/qeth: consolidate errno translation for MAC management s390/qeth: extract qeth_l2_remove_mac()
s390/qeth: shuffle MAC management functions around s390/qeth: issue STARTLAN as first IPA command
Thomas Richter (3):
s390/qeth: rework RX/TX checksum offload command to use call back
functions
s390/qeth: test RX/TX checksum offload reply from hardware s390/qeth: display warning for OSA3 RX/TX checksum offloading
Ursula Braun (2):
s390/qeth: fix retrieval of vipa and proxy-arp addresses s390/qeth: remove OSN-devices
drivers/s390/net/qeth_core.h | 33 --- drivers/s390/net/qeth_core_main.c | 188 +++++++++------- drivers/s390/net/qeth_core_mpc.c | 3 - drivers/s390/net/qeth_core_mpc.h | 27 ++- drivers/s390/net/qeth_core_sys.c | 17 -- drivers/s390/net/qeth_l2_main.c | 456 +++++++++++--------------------------- drivers/s390/net/qeth_l3_main.c | 15 -- drivers/s390/net/qeth_l3_sys.c | 33 ++- 8 files changed, 268 insertions(+), 504 deletions(-)
Signature · 1 line
2.8.4
PATCH 1/13 s390/qeth: rework RX/TX checksum offload
From: Thomas Richter <[email protected]>
Rework the RX/TX checksum offloading command sequence to use the provided function call back mechanims to return card data to the device driver.
--- drivers/s390/net/qeth_core.h | 2 - drivers/s390/net/qeth_core_main.c | 96 ++++++++++++++++++++++++++------------- drivers/s390/net/qeth_core_mpc.h | 7 +++ 3 files changed, 72 insertions(+), 33 deletions(-)
drivers/s390/net/qeth_core.h +0 -2
@@ -674,8 +674,6 @@ struct qeth_card_info {int broadcast_capable;int unique_id;struct qeth_card_blkt blkt; -__u32 csum_mask; -__u32 tx_csum_mask;enum qeth_ipa_promisc_modes promisc_mode;__u32 diagass_support;__u32 hwtrap;
drivers/s390/net/qeth_core_main.c +65 -31
125 lines not on this page · raw message
drivers/s390/net/qeth_core_mpc.h +7 -0
@@ -352,11 +352,18 @@ struct qeth_arp_query_info {char *udata; }; +/* IPA Assist checksum offload reply layout. */ +struct qeth_checksum_cmd { +__u32 supported; +__u32 enabled; +} __packed; +/* SETASSPARMS IPA Command: */ struct qeth_ipacmd_setassparms {struct qeth_ipacmd_setassparms_hdr hdr;union {__u32 flags_32bit; +struct qeth_checksum_cmd chksum;struct qeth_arp_cache_entry add_arp_entry;struct qeth_arp_query_data query_arp;__u8 ip[16 ];
Signature · 1 line
2.8.4
PATCH 2/13 s390/qeth: test RX/TX checksum offload reply
In reply to Ursula BraunFrom: Thomas Richter <[email protected]>
Turning on receive and/or transmit checksum offload support on the OSA card requires 2 commands:
1. start command which replies with available features
2. enable command to turn on selected features.
The current version does not check the reply of the start command and simply uses the returned value to enable offload features. When the start command returns zero, this leads to a situation where no checksum offload
is turned on by the hardware. Even worse no error indication is returned. The Linux kernel assumes
the OSA card performs RX/TX checksum offload, but the hardware does not perform any checksum verification at all.
This patch checks the return of the start and enable command responses from the hardware and turns off checksum offloading if the commands fails or does not respond with the correct bit setting.
--- drivers/s390/net/qeth_core_main.c | 13 +++++++++++++ drivers/s390/net/qeth_core_mpc.h | 10 ++++++++++ 2 files changed, 23 insertions(+)
drivers/s390/net/qeth_core_main.c +13 -0
@@ -6104,11 +6104,19 @@ static int qeth_ipa_checksum_run_cmd(struct qeth_card *card,static int qeth_send_checksum_on (struct qeth_card *card,int cstype) { +const __u32 required_features =QETH_IPA_CHECKSUM_IP_HDR | +QETH_IPA_CHECKSUM_UDP | +QETH_IPA_CHECKSUM_TCP ;struct qeth_checksum_cmd chksum_cb;int rc; rc =qeth_ipa_checksum_run_cmd (card, cstype,IPA_CMD_ASS_START ,0 , &chksum_cb); +if (!rc) { +if ((required_features & chksum_cb.supported) != + required_features) + rc = -EIO ; + }if (rc) {qeth_send_simple_setassparms (card, cstype,IPA_CMD_ASS_STOP ,0 ); dev_warn(&card->gdev->dev,
@@ -6118,6 +6126,11 @@ static int qeth_send_checksum_on(struct qeth_card *card, int cstype) } rc =qeth_ipa_checksum_run_cmd (card, cstype,IPA_CMD_ASS_ENABLE , chksum_cb.supported, &chksum_cb); +if (!rc) { +if ((required_features & chksum_cb.enabled) != + required_features) + rc = -EIO ; + }if (rc) {qeth_send_simple_setassparms (card, cstype,IPA_CMD_ASS_STOP ,0 ); dev_warn(&card->gdev->dev,
drivers/s390/net/qeth_core_mpc.h +10 -0
@@ -352,6 +352,16 @@ struct qeth_arp_query_info {char *udata; }; +/* IPA set assist segmentation bit definitions for receive and +* transmit checksum offloading. +*/ +enum qeth_ipa_checksum_bits { +QETH_IPA_CHECKSUM_IP_HDR =0x0002 , +QETH_IPA_CHECKSUM_UDP =0x0008 , +QETH_IPA_CHECKSUM_TCP =0x0010 , +QETH_IPA_CHECKSUM_LP2LP =0x0020 +}; +/* IPA Assist checksum offload reply layout. */ struct qeth_checksum_cmd {__u32 supported;
Signature · 1 line
2.8.4
PATCH 3/13 s390/qeth: warning for OSA3 RX/TX checksum offloading
In reply to Ursula BraunFrom: Thomas Richter <[email protected]>
When RX/TX checksum offloading is turned on and the adapter is an OSA 3 card in layer 3 mode, the checksum offloading is only performed when both peers use different adapters. If both peers share an OSA 3 card, communication is a memory copy and checksum offloading is not performed.
This patch adds a warning to inform the administrator.
OSA 3 in layer 2 mode does not offer the RX/TX checksum offload feature.
--- drivers/s390/net/qeth_core_main.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/s390/net/qeth_core_main.c +5 -0
@@ -6116,6 +6116,11 @@ static int qeth_send_checksum_on(struct qeth_card *card, int cstype)if ((required_features & chksum_cb.supported) != required_features) rc = -EIO ; +else if (!(QETH_IPA_CHECKSUM_LP2LP & chksum_cb.supported) && + cstype ==IPA_INBOUND_CHECKSUM ) +dev_warn (&card->gdev->dev, +"Hardware checksumming is performed only if %s and its peer use different OSA Express 3 ports\n" , +QETH_CARD_IFNAME (card)); }if (rc) {qeth_send_simple_setassparms (card, cstype,IPA_CMD_ASS_STOP ,0 );
Signature · 1 line
2.8.4
PATCH 4/13 s390/qeth: Allow reading hsuid in state DOWN
In reply to Ursula BraunFrom: Julian Wiedmann <[email protected]>
Accessing the current hsuid via card->options.hsuid is perfectly fine, even when the card is DOWN.
--- drivers/s390/net/qeth_l3_sys.c | 3 --- 1 file changed, 3 deletions(-)
drivers/s390/net/qeth_l3_sys.c +0 -3
@@ -250,9 +250,6 @@ static ssize_t qeth_l3_dev_hsuid_show(struct device *dev,if (card->info.type !=QETH_CARD_TYPE_IQD )return -EPERM ; -if (card->state ==CARD_STATE_DOWN ) -return -EPERM ; -memcpy (tmp_hsuid, card->options.hsuid,sizeof (tmp_hsuid));EBCASC (tmp_hsuid,8 );return sprintf (buf,"%s\n" , tmp_hsuid);
Signature · 1 line
2.8.4
PATCH 5/13 s390/qeth: Remove QETH_IP_HEADER_SIZE
In reply to Ursula BraunFrom: Julian Wiedmann <[email protected]>
Remove unused define QETH_IP_HEADER_SIZE.
--- drivers/s390/net/qeth_core.h | 2 -- 1 file changed, 2 deletions(-)
drivers/s390/net/qeth_core.h +0 -2
@@ -281,8 +281,6 @@ static inline int qeth_is_ipa_enabled(struct qeth_ipa_info *ipa,#define QETH_HIGH_WATERMARK_PACK 5#define QETH_WATERMARK_PACK_FUZZ 1 -#define QETH_IP_HEADER_SIZE 40 -/* large receive scatter gather copy break */ #define QETH_RX_SG_CB (PAGE_SIZE >> 1)#define QETH_RX_PULL_LEN 256
Signature · 1 line
2.8.4
PATCH 6/13 s390/qeth: drop qeth_l2_del_all_macs() parameter
In reply to Ursula BraunFrom: Julian Wiedmann <[email protected]>
The only caller passes del = 0, so remove both the parameter and the code that handles != 0.
--- drivers/s390/net/qeth_l2_main.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/s390/net/qeth_l2_main.c +2 -9
@@ -216,7 +216,7 @@ static int qeth_l2_write_mac(struct qeth_card *card, struct qeth_mac *mac)return rc; } -static void qeth_l2_del_all_macs (struct qeth_card *card,int del) +static void qeth_l2_del_all_macs (struct qeth_card *card) {struct qeth_mac *mac;struct hlist_node *tmp;
@@ -224,13 +224,6 @@ static void qeth_l2_del_all_macs(struct qeth_card *card, int del)spin_lock_bh (&card->mclock);hash_for_each_safe (card->mac_htable, i, tmp, mac, hnode) { -if (del) { -if (mac->is_uc) -qeth_l2_send_setdelmac (card, mac->mac_addr, -IPA_CMD_DELVMAC ); -else -qeth_l2_send_delgroupmac (card, mac->mac_addr); - }hash_del (&mac->hnode);kfree (mac); }
@@ -425,7 +418,7 @@ static void qeth_l2_stop_card(struct qeth_card *card, int recovery_mode) card->state =CARD_STATE_SOFTSETUP ; }if (card->state ==CARD_STATE_SOFTSETUP ) { -qeth_l2_del_all_macs (card,0 ); +qeth_l2_del_all_macs (card);qeth_clear_ipacmd_list (card); card->state =CARD_STATE_HARDSETUP ; }
Signature · 1 line
2.8.4
PATCH 7/13 s390/qeth: don't convert return code twice
In reply to Ursula BraunFrom: Julian Wiedmann <[email protected]>
qeth_l2_send_groupmac() already translates the return code, so calling qeth_setdel_makerc() a second time only produces garbage.
--- drivers/s390/net/qeth_l2_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/s390/net/qeth_l2_main.c +1 -2
@@ -210,8 +210,7 @@ static int qeth_l2_write_mac(struct qeth_card *card, struct qeth_mac *mac)qeth_l2_send_setdelmac (card, mac->mac_addr, IPA_CMD_SETVMAC)); }else { - rc =qeth_setdel_makerc (card, -qeth_l2_send_setgroupmac (card, mac->mac_addr)); + rc =qeth_l2_send_setgroupmac (card, mac->mac_addr); }return rc; }
Signature · 1 line
2.8.4
PATCH 8/13 s390/qeth: consolidate errno translation
In reply to Ursula BraunFrom: Julian Wiedmann <[email protected]>
Consolidate errno handling for MAC management: Instead of doing this in every caller, do it in one place.
--- drivers/s390/net/qeth_l2_main.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
drivers/s390/net/qeth_l2_main.c +8 -12
@@ -170,8 +170,7 @@ static int qeth_l2_send_setgroupmac(struct qeth_card *card, __u8 *mac)int rc;QETH_CARD_TEXT (card,2 ,"L2Sgmac" ); - rc =qeth_setdel_makerc (card,qeth_l2_send_setdelmac (card, mac, -IPA_CMD_SETGMAC )); + rc =qeth_l2_send_setdelmac (card, mac,IPA_CMD_SETGMAC );if (rc == -EEXIST )QETH_DBF_MESSAGE (2 ,"Group MAC %pM already existing on %s\n" , mac,QETH_CARD_IFNAME (card));
@@ -186,8 +185,7 @@ static int qeth_l2_send_delgroupmac(struct qeth_card *card, __u8 *mac)int rc;QETH_CARD_TEXT (card,2 ,"L2Dgmac" ); - rc =qeth_setdel_makerc (card,qeth_l2_send_setdelmac (card, mac, -IPA_CMD_DELGMAC )); + rc =qeth_l2_send_setdelmac (card, mac,IPA_CMD_DELGMAC );if (rc) QETH_DBF_MESSAGE(2, "Could not delete group MAC %pM on %s: %d\n",
@@ -206,9 +204,8 @@ static int qeth_l2_write_mac(struct qeth_card *card, struct qeth_mac *mac)int rc;if (mac->is_uc) { - rc =qeth_setdel_makerc (card, -qeth_l2_send_setdelmac (card, mac->mac_addr, -IPA_CMD_SETVMAC )); + rc =qeth_l2_send_setdelmac (card, mac->mac_addr, +IPA_CMD_SETVMAC ); }else { rc =qeth_l2_send_setgroupmac (card, mac->mac_addr); }
@@ -582,7 +579,8 @@ static int qeth_l2_send_setdelmac(struct qeth_card *card, __u8 *mac, cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE ); cmd->data.setdelmac.mac_length =OSA_ADDR_LEN ;memcpy (&cmd->data.setdelmac.mac, mac,OSA_ADDR_LEN ); -return qeth_send_ipa_cmd (card, iob,NULL ,NULL ); +return qeth_setdel_makerc (card,qeth_send_ipa_cmd (card, iob, +NULL ,NULL )); }static int qeth_l2_send_setmac (struct qeth_card *card,__u8 *mac)
@@ -590,8 +588,7 @@ static int qeth_l2_send_setmac(struct qeth_card *card, __u8 *mac)int rc;QETH_CARD_TEXT (card,2 ,"L2Setmac" ); - rc =qeth_setdel_makerc (card,qeth_l2_send_setdelmac (card, mac, -IPA_CMD_SETVMAC )); + rc =qeth_l2_send_setdelmac (card, mac,IPA_CMD_SETVMAC );if (rc ==0 ) { card->info.mac_bits |=QETH_LAYER2_MAC_REGISTERED ;memcpy (card->dev->dev_addr, mac,OSA_ADDR_LEN );
@@ -621,8 +618,7 @@ static int qeth_l2_send_delmac(struct qeth_card *card, __u8 *mac)QETH_CARD_TEXT (card,2 ,"L2Delmac" );if (!(card->info.mac_bits &QETH_LAYER2_MAC_REGISTERED ))return 0 ; - rc =qeth_setdel_makerc (card,qeth_l2_send_setdelmac (card, mac, -IPA_CMD_DELVMAC )); + rc =qeth_l2_send_setdelmac (card, mac,IPA_CMD_DELVMAC );if (rc ==0 ) card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED ;return rc;
Signature · 1 line
2.8.4
PATCH 9/13 s390/qeth: extract qeth_l2_remove_mac()
In reply to Ursula BraunFrom: Julian Wiedmann <[email protected]>
This matches qeth_l2_write_mac().
--- drivers/s390/net/qeth_l2_main.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-)
drivers/s390/net/qeth_l2_main.c +13 -14
@@ -200,16 +200,22 @@ static inline u32 qeth_l2_mac_hash(const u8 *addr)static int qeth_l2_write_mac (struct qeth_card *card,struct qeth_mac *mac) { - -int rc; -if (mac->is_uc) { - rc =qeth_l2_send_setdelmac (card, mac->mac_addr, +return qeth_l2_send_setdelmac (card, mac->mac_addr,IPA_CMD_SETVMAC ); }else { - rc =qeth_l2_send_setgroupmac (card, mac->mac_addr); +return qeth_l2_send_setgroupmac (card, mac->mac_addr); + } +} + +static int qeth_l2_remove_mac (struct qeth_card *card,struct qeth_mac *mac) +{ +if (mac->is_uc) { +return qeth_l2_send_setdelmac (card, mac->mac_addr, +IPA_CMD_DELVMAC ); + }else { +return qeth_l2_send_delgroupmac (card, mac->mac_addr); } -return rc; }static void qeth_l2_del_all_macs (struct qeth_card *card)
@@ -782,14 +788,7 @@ static void qeth_l2_set_rx_mode(struct net_device *dev)hash_for_each_safe (card->mac_htable, i, tmp, mac, hnode) {if (mac->disp_flag ==QETH_DISP_ADDR_DELETE ) { -if (!mac->is_uc) - rc =qeth_l2_send_delgroupmac (card, - mac->mac_addr); -else { - rc =qeth_l2_send_setdelmac (card, mac->mac_addr, -IPA_CMD_DELVMAC ); - } - +qeth_l2_remove_mac (card, mac);hash_del (&mac->hnode);kfree (mac);
Signature · 1 line
2.8.4
PATCH 10/13 s390/qeth: shuffle MAC management functions around
In reply to Ursula BraunFrom: Julian Wiedmann <[email protected]>
Move all MAC utility functions in one place, and drop the forward declarations.
--- drivers/s390/net/qeth_l2_main.c | 129 ++++++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 66 deletions(-)
drivers/s390/net/qeth_l2_main.c +63 -66
@@ -27,9 +27,6 @@static int qeth_l2_set_offline (struct ccwgroup_device *);static int qeth_l2_stop (struct net_device *); -static int qeth_l2_send_delmac (struct qeth_card *,__u8 *); -static int qeth_l2_send_setdelmac (struct qeth_card *,__u8 *, -enum qeth_ipa_cmds );static void qeth_l2_set_rx_mode (struct net_device *);static int qeth_l2_recover (void *);static void qeth_bridgeport_query_support (struct qeth_card *card);
@@ -165,6 +162,64 @@ static int qeth_setdel_makerc(struct qeth_card *card, int retcode)return rc; } +static int qeth_l2_send_setdelmac (struct qeth_card *card,__u8 *mac, +enum qeth_ipa_cmds ipacmd) +{ +struct qeth_ipa_cmd *cmd; +struct qeth_cmd_buffer *iob; + +QETH_CARD_TEXT (card,2 ,"L2sdmac" ); + iob =qeth_get_ipacmd_buffer (card, ipacmd,QETH_PROT_IPV4 ); +if (!iob) +return -ENOMEM ; + cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE ); + cmd->data.setdelmac.mac_length =OSA_ADDR_LEN ; +memcpy (&cmd->data.setdelmac.mac, mac,OSA_ADDR_LEN ); +return qeth_setdel_makerc (card,qeth_send_ipa_cmd (card, iob, +NULL ,NULL )); +} + +static int qeth_l2_send_setmac (struct qeth_card *card,__u8 *mac) +{ +int rc; + +QETH_CARD_TEXT (card,2 ,"L2Setmac" ); + rc =qeth_l2_send_setdelmac (card, mac,IPA_CMD_SETVMAC ); +if (rc ==0 ) { + card->info.mac_bits |=QETH_LAYER2_MAC_REGISTERED ; +memcpy (card->dev->dev_addr, mac,OSA_ADDR_LEN ); +dev_info (&card->gdev->dev, +"MAC address %pM successfully registered on device %s\n" , + card->dev->dev_addr, card->dev->name); + }else { + card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED ; +switch (rc) { +case -EEXIST : +dev_warn (&card->gdev->dev, +"MAC address %pM already exists\n" , mac); +break ; +case -EPERM : +dev_warn (&card->gdev->dev, +"MAC address %pM is not authorized\n" , mac); +break ; + } + } +return rc; +} + +static int qeth_l2_send_delmac (struct qeth_card *card,__u8 *mac) +{ +int rc; + +QETH_CARD_TEXT (card,2 ,"L2Delmac" ); +if (!(card->info.mac_bits &QETH_LAYER2_MAC_REGISTERED )) +return 0 ; + rc =qeth_l2_send_setdelmac (card, mac,IPA_CMD_DELVMAC ); +if (rc ==0 ) + card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED ; +return rc; +} +static int qeth_l2_send_setgroupmac (struct qeth_card *card,__u8 *mac) {int rc;
@@ -193,11 +248,6 @@ static int qeth_l2_send_delgroupmac(struct qeth_card *card, __u8 *mac)return rc; } -static inline u32 qeth_l2_mac_hash (const u8 *addr) -{ -return get_unaligned ((u32 *)(&addr[2 ])); -} -static int qeth_l2_write_mac (struct qeth_card *card,struct qeth_mac *mac) {if (mac->is_uc) {
@@ -232,6 +282,11 @@ static void qeth_l2_del_all_macs(struct qeth_card *card)spin_unlock_bh (&card->mclock); } +static inline u32 qeth_l2_mac_hash (const u8 *addr) +{ +return get_unaligned ((u32 *)(&addr[2 ])); +} +static inline int qeth_l2_get_cast_type (struct qeth_card *card,struct sk_buff *skb) {
@@ -572,64 +627,6 @@ static int qeth_l2_poll(struct napi_struct *napi, int budget)return work_done; } -static int qeth_l2_send_setdelmac (struct qeth_card *card,__u8 *mac, -enum qeth_ipa_cmds ipacmd) -{ -struct qeth_ipa_cmd *cmd; -struct qeth_cmd_buffer *iob; - -QETH_CARD_TEXT (card,2 ,"L2sdmac" ); - iob =qeth_get_ipacmd_buffer (card, ipacmd,QETH_PROT_IPV4 ); -if (!iob) -return -ENOMEM ; - cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE ); - cmd->data.setdelmac.mac_length =OSA_ADDR_LEN ; -memcpy (&cmd->data.setdelmac.mac, mac,OSA_ADDR_LEN ); -return qeth_setdel_makerc (card,qeth_send_ipa_cmd (card, iob, -NULL ,NULL )); -} - -static int qeth_l2_send_setmac (struct qeth_card *card,__u8 *mac) -{ -int rc; - -QETH_CARD_TEXT (card,2 ,"L2Setmac" ); - rc =qeth_l2_send_setdelmac (card, mac,IPA_CMD_SETVMAC ); -if (rc ==0 ) { - card->info.mac_bits |=QETH_LAYER2_MAC_REGISTERED ; -memcpy (card->dev->dev_addr, mac,OSA_ADDR_LEN ); -dev_info (&card->gdev->dev, -"MAC address %pM successfully registered on device %s\n" , - card->dev->dev_addr, card->dev->name); - }else { - card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED ; -switch (rc) { -case -EEXIST : -dev_warn (&card->gdev->dev, -"MAC address %pM already exists\n" , mac); -break ; -case -EPERM : -dev_warn (&card->gdev->dev, -"MAC address %pM is not authorized\n" , mac); -break ; - } - } -return rc; -} - -static int qeth_l2_send_delmac (struct qeth_card *card,__u8 *mac) -{ -int rc; - -QETH_CARD_TEXT (card,2 ,"L2Delmac" ); -if (!(card->info.mac_bits &QETH_LAYER2_MAC_REGISTERED )) -return 0 ; - rc =qeth_l2_send_setdelmac (card, mac,IPA_CMD_DELVMAC ); -if (rc ==0 ) - card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED ; -return rc; -} -static int qeth_l2_request_initial_mac (struct qeth_card *card) {int rc =0 ;
Signature · 1 line
2.8.4
PATCH 11/13 s390/qeth: issue STARTLAN as first IPA command
In reply to Ursula BraunFrom: Julian Wiedmann <[email protected]>
STARTLAN needs to be the first IPA command after MPC initialization completes.
So move the qeth_send_startlan() call from the layer disciplines into the core path, right after the MPC handshake.
While at it, replace the magic LAN OFFLINE return code with the existing enum.
--- drivers/s390/net/qeth_core.h | 1 - drivers/s390/net/qeth_core_main.c | 21 +++++++++++++++++---- drivers/s390/net/qeth_l2_main.c | 15 --------------- drivers/s390/net/qeth_l3_main.c | 15 --------------- 4 files changed, 17 insertions(+), 35 deletions(-)
drivers/s390/net/qeth_core.h +0 -1
@@ -913,7 +913,6 @@ void qeth_clear_thread_running_bit(struct qeth_card *, unsigned long);int qeth_core_hardsetup_card (struct qeth_card *);void qeth_print_status_message (struct qeth_card *);int qeth_init_qdio_queues (struct qeth_card *); -int qeth_send_startlan (struct qeth_card *); int qeth_send_ipa_cmd(struct qeth_card *, struct qeth_cmd_buffer *, int (*reply_cb) (struct qeth_card *, struct qeth_reply *, unsigned long),
drivers/s390/net/qeth_core_main.c +17 -4
@@ -2944,7 +2944,7 @@ int qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, }EXPORT_SYMBOL_GPL (qeth_send_ipa_cmd); -int qeth_send_startlan (struct qeth_card *card) +static int qeth_send_startlan (struct qeth_card *card) {int rc;struct qeth_cmd_buffer *iob;
@@ -2957,7 +2957,6 @@ int qeth_send_startlan(struct qeth_card *card) rc =qeth_send_ipa_cmd (card, iob,NULL ,NULL );return rc; } -EXPORT_SYMBOL_GPL (qeth_send_startlan);static int qeth_default_setadapterparms_cb (struct qeth_card *card,struct qeth_reply *reply,unsigned long data)
@@ -5087,6 +5086,20 @@ int qeth_core_hardsetup_card(struct qeth_card *card) goto out; } + rc =qeth_send_startlan (card); +if (rc) { +QETH_DBF_TEXT_ (SETUP ,2 ,"6err%d" , rc); +if (rc ==IPA_RC_LAN_OFFLINE ) { +dev_warn (&card->gdev->dev, +"The LAN is offline\n" ); + card->lan_online =0 ; + }else { + rc = -ENODEV ; + goto out; + } + }else + card->lan_online =1 ; + card->options.ipa4.supported_funcs =0 ; card->options.ipa6.supported_funcs =0 ; card->options.adp.supported_funcs =0 ;
@@ -5098,14 +5111,14 @@ int qeth_core_hardsetup_card(struct qeth_card *card)if (qeth_is_supported (card,IPA_SETADAPTERPARMS )) { rc =qeth_query_setadapterparms (card);if (rc <0 ) { -QETH_DBF_TEXT_ (SETUP ,2 ,"6err%d" , rc); +QETH_DBF_TEXT_ (SETUP ,2 ,"7err%d" , rc); goto out; } }if (qeth_adp_supported (card,IPA_SETADP_SET_DIAG_ASSIST )) { rc =qeth_query_setdiagass (card);if (rc <0 ) { -QETH_DBF_TEXT_ (SETUP ,2 ,"7err%d" , rc); +QETH_DBF_TEXT_ (SETUP ,2 ,"8err%d" , rc); goto out; } }
drivers/s390/net/qeth_l2_main.c +0 -15
@@ -1177,21 +1177,6 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)/* softsetup */ QETH_DBF_TEXT (SETUP ,2 ,"softsetp" ); - rc =qeth_send_startlan (card); -if (rc) { -QETH_DBF_TEXT_ (SETUP ,2 ,"1err%d" , rc); -if (rc ==0xe080 ) { -dev_warn (&card->gdev->dev, -"The LAN is offline\n" ); - card->lan_online =0 ; - goto contin; - } - rc = -ENODEV ; - goto out_remove; - }else - card->lan_online =1 ; - -contin:if ((card->info.type ==QETH_CARD_TYPE_OSD ) || (card->info.type ==QETH_CARD_TYPE_OSX )) { rc =qeth_l2_start_ipassists (card);
drivers/s390/net/qeth_l3_main.c +0 -15
@@ -3227,21 +3227,6 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode)/* softsetup */ QETH_DBF_TEXT (SETUP ,2 ,"softsetp" ); - rc =qeth_send_startlan (card); -if (rc) { -QETH_DBF_TEXT_ (SETUP ,2 ,"1err%d" , rc); -if (rc ==0xe080 ) { -dev_warn (&card->gdev->dev, -"The LAN is offline\n" ); - card->lan_online =0 ; - goto contin; - } - rc = -ENODEV ; - goto out_remove; - }else - card->lan_online =1 ; - -contin: rc =qeth_l3_setadapter_parms (card);if (rc)QETH_DBF_TEXT_ (SETUP ,2 ,"2err%04x" , rc);
Signature · 1 line
2.8.4
PATCH 12/13 s390/qeth: fix retrieval of vipa and proxy-arp addresses
In reply to Ursula Braunqeth devices in layer3 mode need a separate handling of vipa and proxy-arp addresses. vipa and proxy-arp addresses processed by qeth can be read from userspace. Introduced with commit 5f78e29ceebf ("qeth: optimize IP handling in rx_mode callback") the retrieval of vipa and proxy-arp addresses is broken, if more than one vipa or proxy-arp address are set.
The qeth code used local variable "int i" for 2 different purposes. This patch now spends 2 separate local variables of type "int". While touching these functions hash_for_each_safe() is converted to hash_for_each(), since there is no removal of hash entries.
--- drivers/s390/net/qeth_l3_sys.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-)
drivers/s390/net/qeth_l3_sys.c +16 -14
@@ -689,15 +689,15 @@ static ssize_t qeth_l3_dev_vipa_add_show(char *buf, struct qeth_card *card, enum qeth_prot_versions proto) {struct qeth_ipaddr *ipaddr; -struct hlist_node *tmp;char addr_str[40 ]; +int str_len =0 ;int entry_len;/* length of 1 entry string, differs between v4 and v6 */ -int i =0 ; +int i; entry_len = (proto ==QETH_PROT_IPV4 )?12 :40 ; entry_len +=2 ;/* \n + terminator */ spin_lock_bh (&card->ip_lock); -hash_for_each_safe (card->ip_htable, i, tmp, ipaddr, hnode) { +hash_for_each (card->ip_htable, i, ipaddr, hnode) {if (ipaddr->proto != proto)continue ;if (ipaddr->type !=QETH_IP_TYPE_VIPA )
@@ -705,16 +705,17 @@ static ssize_t qeth_l3_dev_vipa_add_show(char *buf, struct qeth_card *card,/* String must not be longer than PAGE_SIZE. So we check if * string length gets near PAGE_SIZE. Then we can savely display * the next IPv6 address (worst case, compared to IPv4) */ -if ((PAGE_SIZE - i) <= entry_len) +if ((PAGE_SIZE - str_len) <= entry_len)break ;qeth_l3_ipaddr_to_string (proto, (const u8 *)&ipaddr->u, addr_str); - i +=snprintf (buf + i,PAGE_SIZE - i,"%s\n" , addr_str); + str_len +=snprintf (buf + str_len,PAGE_SIZE - str_len,"%s\n" , + addr_str); }spin_unlock_bh (&card->ip_lock); - i +=snprintf (buf + i,PAGE_SIZE - i,"\n" ); + str_len +=snprintf (buf + str_len,PAGE_SIZE - str_len,"\n" ); -return i; +return str_len; } static ssize_t qeth_l3_dev_vipa_add4_show(struct device *dev,
@@ -851,15 +852,15 @@ static ssize_t qeth_l3_dev_rxip_add_show(char *buf, struct qeth_card *card, enum qeth_prot_versions proto) {struct qeth_ipaddr *ipaddr; -struct hlist_node *tmp;char addr_str[40 ]; +int str_len =0 ;int entry_len;/* length of 1 entry string, differs between v4 and v6 */ -int i =0 ; +int i; entry_len = (proto ==QETH_PROT_IPV4 )?12 :40 ; entry_len +=2 ;/* \n + terminator */ spin_lock_bh (&card->ip_lock); -hash_for_each_safe (card->ip_htable, i, tmp, ipaddr, hnode) { +hash_for_each (card->ip_htable, i, ipaddr, hnode) {if (ipaddr->proto != proto)continue ;if (ipaddr->type !=QETH_IP_TYPE_RXIP )
@@ -867,16 +868,17 @@ static ssize_t qeth_l3_dev_rxip_add_show(char *buf, struct qeth_card *card,/* String must not be longer than PAGE_SIZE. So we check if * string length gets near PAGE_SIZE. Then we can savely display * the next IPv6 address (worst case, compared to IPv4) */ -if ((PAGE_SIZE - i) <= entry_len) +if ((PAGE_SIZE - str_len) <= entry_len)break ;qeth_l3_ipaddr_to_string (proto, (const u8 *)&ipaddr->u, addr_str); - i +=snprintf (buf + i,PAGE_SIZE - i,"%s\n" , addr_str); + str_len +=snprintf (buf + str_len,PAGE_SIZE - str_len,"%s\n" , + addr_str); }spin_unlock_bh (&card->ip_lock); - i +=snprintf (buf + i,PAGE_SIZE - i,"\n" ); + str_len +=snprintf (buf + str_len,PAGE_SIZE - str_len,"\n" ); -return i; +return str_len; } static ssize_t qeth_l3_dev_rxip_add4_show(struct device *dev,
Signature · 1 line
2.8.4
PATCH 13/13 s390/qeth: remove OSN-devices
In reply to Ursula BraunCHPID type "OSN" is a device type which had been used by IBM product "Communication Controller for Linux". This product has reached end of service in March 2016. Thus OSN support can be removed from the qeth driver.
--- drivers/s390/net/qeth_core.h | 28 ---- drivers/s390/net/qeth_core_main.c | 53 ++------ drivers/s390/net/qeth_core_mpc.c | 3 - drivers/s390/net/qeth_core_mpc.h | 10 +- drivers/s390/net/qeth_core_sys.c | 17 --- drivers/s390/net/qeth_l2_main.c | 267 +++++++------------------------------- 6 files changed, 56 insertions(+), 322 deletions(-)
drivers/s390/net/qeth_core.h +0 -28
@@ -310,22 +310,10 @@ struct qeth_hdr_layer2 {__u8 reserved2[16 ]; } __attribute__ ((packed)); -struct qeth_hdr_osn { -__u8 id; -__u8 reserved; -__u16 seq_no; -__u16 reserved2; -__u16 control_flags; -__u16 pdu_length; -__u8 reserved3[18 ]; -__u32 ccid; -} __attribute__ ((packed)); -struct qeth_hdr {union {struct qeth_hdr_layer2 l2;struct qeth_hdr_layer3 l3; -struct qeth_hdr_osn osn; } hdr; } __attribute__ ((packed));
@@ -372,7 +360,6 @@ enum qeth_header_ids {QETH_HEADER_TYPE_LAYER3 =0x01 ,QETH_HEADER_TYPE_LAYER2 =0x02 , QETH_HEADER_TYPE_TSO = 0x03, - QETH_HEADER_TYPE_OSN = 0x04, };/* flags for qeth_hdr.ext_flags */ #define QETH_HDR_EXT_VLAN_FRAME 0x01
@@ -627,7 +614,6 @@ struct qeth_seqno {__u32 pdu_hdr;__u32 pdu_hdr_ack;__u16 ipa; -__u32 pkt_seqno; };struct qeth_reply {
@@ -703,11 +689,6 @@ enum qeth_threads { QETH_RECOVER_THREAD = 1, }; -struct qeth_osn_info { -int (*assist_cb)(struct net_device *dev,void *data); -int (*data_cb)(struct sk_buff *skb); -}; -enum qeth_discipline_id {QETH_DISCIPLINE_LAYER3 =0 ,QETH_DISCIPLINE_LAYER2 =1 ,
@@ -803,7 +784,6 @@ struct qeth_card {struct qeth_qdio_info qdio;struct qeth_perf_stats perf_stats;int read_or_write_problem; -struct qeth_osn_info osn_info;struct qeth_discipline *discipline;atomic_t force_alloc_skb;struct service_level qeth_service_level;
@@ -888,7 +868,6 @@ static inline int qeth_is_diagass_supported(struct qeth_card *card,extern struct qeth_discipline qeth_l2_discipline;extern struct qeth_discipline qeth_l3_discipline;extern const struct attribute_group *qeth_generic_attr_groups[]; -extern const struct attribute_group *qeth_osn_attr_groups[];extern struct workqueue_struct *qeth_wq;int qeth_card_hw_is_reachable (struct qeth_card *);
@@ -997,11 +976,4 @@ int qeth_set_features(struct net_device *, netdev_features_t);int qeth_recover_features (struct net_device *);netdev_features_t qeth_fix_features (struct net_device *,netdev_features_t ); -/* exports for OSN */ -int qeth_osn_assist (struct net_device *,void *,int ); -int qeth_osn_register (unsigned char *read_dev_no,struct net_device **, -int (*assist_cb)(struct net_device *,void *), -int (*data_cb)(struct sk_buff *)); -void qeth_osn_deregister (struct net_device *); -#endif /* __QETH_CORE_H__ */
drivers/s390/net/qeth_core_main.c +10 -43
151 lines not on this page · raw message
drivers/s390/net/qeth_core_mpc.c +0 -3
@@ -238,9 +238,6 @@ static struct ipa_cmd_names qeth_ipa_cmd_names[] = { {IPA_CMD_SETVLAN, "setvlan"}, {IPA_CMD_DELVLAN, "delvlan"}, {IPA_CMD_SETBRIDGEPORT_OSA, "set_bridge_port(osa)"}, - {IPA_CMD_SETCCID, "setccid"}, - {IPA_CMD_DELCCID, "delccid"}, - {IPA_CMD_MODCCID, "modccid"}, {IPA_CMD_SETIP, "setip"}, {IPA_CMD_QIPASSIST, "qipassist"}, {IPA_CMD_SETASSPARMS, "setassparms"},
drivers/s390/net/qeth_core_mpc.h +1 -9
@@ -40,8 +40,6 @@ extern unsigned char IPA_PDU_HEADER[];/*****************************************************************************/ #define IPA_CMD_INITIATOR_HOST 0x00#define IPA_CMD_INITIATOR_OSA 0x01 -#define IPA_CMD_INITIATOR_HOST_REPLY 0x80 -#define IPA_CMD_INITIATOR_OSA_REPLY 0x81#define IPA_CMD_PRIM_VERSION_NO 0x01enum qeth_card_types {
@@ -59,7 +57,6 @@ enum qeth_link_types {QETH_LINK_TYPE_FAST_ETH =0x01 ,QETH_LINK_TYPE_HSTR =0x02 ,QETH_LINK_TYPE_GBIT_ETH =0x03 , -QETH_LINK_TYPE_OSN =0x04 ,QETH_LINK_TYPE_10GBIT_ETH =0x10 ,QETH_LINK_TYPE_LANE_ETH100 =0x81 , QETH_LINK_TYPE_LANE_TR = 0x82,
@@ -93,9 +90,6 @@ enum qeth_ipa_cmds {IPA_CMD_SETVLAN =0x25 ,IPA_CMD_DELVLAN =0x26 ,IPA_CMD_SETBRIDGEPORT_OSA =0x2b , -IPA_CMD_SETCCID =0x41 , -IPA_CMD_DELCCID =0x42 , -IPA_CMD_MODCCID =0x43 ,IPA_CMD_SETIP =0xb1 ,IPA_CMD_QIPASSIST =0xb2 , IPA_CMD_SETASSPARMS = 0xb3,
@@ -717,8 +711,7 @@ extern char *qeth_get_ipa_cmd_name(enum qeth_ipa_cmds cmd);#define QETH_ARP_DATA_SIZE 3968#define QETH_ARP_CMD_LEN (QETH_ARP_DATA_SIZE + 8)/* Helper functions */ -#define IS_IPA_REPLY (cmd) ((cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST) || \ - (cmd->hdr.initiator == IPA_CMD_INITIATOR_OSA_REPLY)) +#define IS_IPA_REPLY (cmd) (cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST)/*****************************************************************************/ /* END OF IP Assist related definitions */
@@ -764,7 +757,6 @@ extern unsigned char ULP_ENABLE[];/* Layer 2 definitions */ #define QETH_PROT_LAYER2 0x08#define QETH_PROT_TCPIP 0x03 -#define QETH_PROT_OSN2 0x0a#define QETH_ULP_ENABLE_PROT_TYPE (buffer) (buffer + 0x50)#define QETH_IPA_CMD_PROT_TYPE (buffer) (buffer + 0x19)
drivers/s390/net/qeth_core_sys.c +0 -17
@@ -735,20 +735,3 @@ const struct attribute_group *qeth_generic_attr_groups[] = { &qeth_device_blkt_group, NULL, }; - -static struct attribute *qeth_osn_device_attrs[] = { - &dev_attr_state.attr, - &dev_attr_chpid.attr, - &dev_attr_if_name.attr, - &dev_attr_card_type.attr, - &dev_attr_buffer_count.attr, - &dev_attr_recover.attr, -NULL , -}; -static struct attribute_group qeth_osn_device_attr_group = { - .attrs = qeth_osn_device_attrs, -}; -const struct attribute_group *qeth_osn_attr_groups[] = { - &qeth_osn_device_attr_group, -NULL , -};
drivers/s390/net/qeth_l2_main.c +45 -222
374 lines not on this page · raw message
Signature · 1 line
2.8.4
David Miller
maintainerRe: [PATCH net-next 13/13] s390/qeth: remove OSN-devices
From: Ursula Braun <[email protected]>
Date: Wed, 11 Jan 2017 12:56:00 +0100
Quoted 8 lines
CHPID type "OSN" is a device type which had been used by IBM product "Communication Controller for Linux". This product has reached end of service in March 2016. Thus OSN support can be removed from the qeth driver.
Signed-off-by Ursula Braun <[email protected]>Reviewed-by Julian Wiedmann <[email protected]>Reviewed-by Thomas Richter <[email protected]>
IBM can certainly decide what physical products it wants to support or not, but this doesn't directly apply to what the Linux kernel driver supports.
We do not unilaterally remove support for a chip from a driver just because the vendor decides to stop supporting that chip. In fact this is one of the main benefits and value-adds of Linux.
I'm not applying a patch series that removes support for a chipset for this reason, sorry.
Re: [PATCH net-next 13/13] s390/qeth: remove OSN-devices
Quoted 16 lines · David Miller
From: Ursula Braun <[email protected]>
Date: Wed, 11 Jan 2017 12:56:00 +0100Quoted 8 lines
CHPID type "OSN" is a device type which had been used by IBM product "Communication Controller for Linux". This product has reached end of service in March 2016. Thus OSN support can be removed from the qeth driver.
Signed-off-by Ursula Braun <[email protected]>Reviewed-by Julian Wiedmann <[email protected]>Reviewed-by Thomas Richter <[email protected]>IBM can certainly decide what physical products it wants to support or not, but this doesn't directly apply to what the Linux kernel driver supports.
Quoted 7 lines
We do not unilaterally remove support for a chip from a driver just because the vendor decides to stop supporting that chip. In fact this is one of the main benefits and value-adds of Linux.
I'm not applying a patch series that removes support for a chipset for this reason, sorry.
Dave,
I am not sure, if the stopped chip support of vendors is something equivalent to the removal of OSN-CHPID support for s390. Probably I used misleading terms like "OSN-device" in my patch description:
The standard networking card on s390 is called
"Open Systems Adapter-Express card" (shortly "OSA-card"), and for sure the qeth driver continues to support it in general. Besides covering traditional Ethernet traffic, an OSA-card can also be used for very IBM-specific purposes.
The mode an OSA-card is running is configured outside of Linux in the mainframe hardware configuration. Linux supports a subset of these modes with the qeth and lcs drivers.
One very specific OSA-mode is the OSN-mode. This mode is one building block for a Linux-assisted approach that allows
existing IBM mainframe operating systems to continue to run IBM Systems Network Architecture (SNA) protocol programs. Just these SNA related code parts in qeth would be removed with this patch.
Do you still think it is important to keep code just needed for IBM SNA traffic in the kernel?
Token Ring support for instance has been removed in 2012. Isn't this something comparable to my intended removal of OSN-mode support in qeth?
In other words: Would it make sense to resend my patch with a better description?
Kind regards, Ursula
cover s390: qeth patches
In reply to Ursula Braunjust realized that I put stable on CC: for this qeth patch series by mistake. This was not intended, sorry!
-------- Forwarded Message --------
Subject: [PATCH net-next 00/13] s390: qeth patches
Date: Wed, 11 Jan 2017 12:55:47 +0100
From: Ursula Braun <[email protected]>
To: [email protected]
CC: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Hi Dave,
here are several fixes for the s390 qeth driver, built for net-next.
Thanks,
Ursula
Julian Wiedmann (8):
s390/qeth: Allow reading hsuid from sysfs while card is DOWN s390/qeth: Remove unused define QETH_IP_HEADER_SIZE s390/qeth: drop unused parameter from qeth_l2_del_all_macs() s390/qeth: when setting group MAC, don't convert return code twice s390/qeth: consolidate errno translation for MAC management s390/qeth: extract qeth_l2_remove_mac()
s390/qeth: shuffle MAC management functions around s390/qeth: issue STARTLAN as first IPA command
Thomas Richter (3):
s390/qeth: rework RX/TX checksum offload command to use call back
functions
s390/qeth: test RX/TX checksum offload reply from hardware s390/qeth: display warning for OSA3 RX/TX checksum offloading
Ursula Braun (2):
s390/qeth: fix retrieval of vipa and proxy-arp addresses s390/qeth: remove OSN-devices
drivers/s390/net/qeth_core.h | 33 --- drivers/s390/net/qeth_core_main.c | 188 +++++++++------- drivers/s390/net/qeth_core_mpc.c | 3 - drivers/s390/net/qeth_core_mpc.h | 27 ++- drivers/s390/net/qeth_core_sys.c | 17 -- drivers/s390/net/qeth_l2_main.c | 456 +++++++++++--------------------------- drivers/s390/net/qeth_l3_main.c | 15 -- drivers/s390/net/qeth_l3_sys.c | 33 ++- 8 files changed, 268 insertions(+), 504 deletions(-)
Signature · 1 line
2.8.4