Skip to content

Commit

Permalink
net/smc: extend LLC layer for SMC-Rv2
Browse files Browse the repository at this point in the history
Add support for large v2 LLC control messages in smc_llc.c.
The new large work request buffer allows to combine control
messages into one packet that had to be spread over several
packets before.
Add handling of the new v2 LLC messages.

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
karstengr authored and davem330 committed Oct 16, 2021
1 parent 8799e31 commit b4ba465
Show file tree
Hide file tree
Showing 7 changed files with 531 additions and 115 deletions.
8 changes: 4 additions & 4 deletions net/smc/af_smc.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,9 @@ static int smc_connect_clc(struct smc_sock *smc,
SMC_CLC_ACCEPT, CLC_WAIT_TIME);
}

static void smc_fill_gid_list(struct smc_link_group *lgr,
struct smc_gidlist *gidlist,
struct smc_ib_device *known_dev, u8 *known_gid)
void smc_fill_gid_list(struct smc_link_group *lgr,
struct smc_gidlist *gidlist,
struct smc_ib_device *known_dev, u8 *known_gid)
{
struct smc_init_info *alt_ini = NULL;

Expand Down Expand Up @@ -1435,7 +1435,7 @@ static int smcr_serv_conf_first_link(struct smc_sock *smc)
smcr_lgr_set_type(link->lgr, SMC_LGR_SINGLE);

/* initial contact - try to establish second link */
smc_llc_srv_add_link(link);
smc_llc_srv_add_link(link, NULL);
return 0;
}

Expand Down
20 changes: 19 additions & 1 deletion net/smc/smc.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,20 @@ enum smc_state { /* possible states of an SMC socket */
struct smc_link_group;

struct smc_wr_rx_hdr { /* common prefix part of LLC and CDC to demultiplex */
u8 type;
union {
u8 type;
#if defined(__BIG_ENDIAN_BITFIELD)
struct {
u8 llc_version:4,
llc_type:4;
};
#elif defined(__LITTLE_ENDIAN_BITFIELD)
struct {
u8 llc_type:4,
llc_version:4;
};
#endif
};
} __aligned(1);

struct smc_cdc_conn_state_flags {
Expand Down Expand Up @@ -286,7 +299,12 @@ static inline bool using_ipsec(struct smc_sock *smc)
}
#endif

struct smc_gidlist;

struct sock *smc_accept_dequeue(struct sock *parent, struct socket *new_sock);
void smc_close_non_accepted(struct sock *sk);
void smc_fill_gid_list(struct smc_link_group *lgr,
struct smc_gidlist *gidlist,
struct smc_ib_device *known_dev, u8 *known_gid);

#endif /* __SMC_H */
1 change: 1 addition & 0 deletions net/smc/smc_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ enum smc_llc_flowtype {
SMC_LLC_FLOW_NONE = 0,
SMC_LLC_FLOW_ADD_LINK = 2,
SMC_LLC_FLOW_DEL_LINK = 4,
SMC_LLC_FLOW_REQ_ADD_LINK = 5,
SMC_LLC_FLOW_RKEY = 6,
};

Expand Down
Loading

0 comments on commit b4ba465

Please sign in to comment.