RDMA/rxe: Fixup rxe_send and rxe_loopback
Fixup rxe_send() and rxe_loopback() in rxe_net.c to have the same calling sequence. This patch makes them static and have the same parameter list and return value. Link: https://lore.kernel.org/r/20210707040040.15434-4-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
parent
36fbb03d05
commit
13050a0b32
|
@ -99,8 +99,6 @@ struct rxe_mw *rxe_lookup_mw(struct rxe_qp *qp, int access, u32 rkey);
|
||||||
void rxe_mw_cleanup(struct rxe_pool_entry *arg);
|
void rxe_mw_cleanup(struct rxe_pool_entry *arg);
|
||||||
|
|
||||||
/* rxe_net.c */
|
/* rxe_net.c */
|
||||||
void rxe_loopback(struct sk_buff *skb);
|
|
||||||
int rxe_send(struct rxe_pkt_info *pkt, struct sk_buff *skb);
|
|
||||||
struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
|
struct sk_buff *rxe_init_packet(struct rxe_dev *rxe, struct rxe_av *av,
|
||||||
int paylen, struct rxe_pkt_info *pkt);
|
int paylen, struct rxe_pkt_info *pkt);
|
||||||
int rxe_prepare(struct rxe_pkt_info *pkt, struct sk_buff *skb, u32 *crc);
|
int rxe_prepare(struct rxe_pkt_info *pkt, struct sk_buff *skb, u32 *crc);
|
||||||
|
|
|
@ -373,7 +373,7 @@ static void rxe_skb_tx_dtor(struct sk_buff *skb)
|
||||||
rxe_drop_ref(qp);
|
rxe_drop_ref(qp);
|
||||||
}
|
}
|
||||||
|
|
||||||
int rxe_send(struct rxe_pkt_info *pkt, struct sk_buff *skb)
|
static int rxe_send(struct sk_buff *skb, struct rxe_pkt_info *pkt)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
@ -406,19 +406,23 @@ int rxe_send(struct rxe_pkt_info *pkt, struct sk_buff *skb)
|
||||||
/* fix up a send packet to match the packets
|
/* fix up a send packet to match the packets
|
||||||
* received from UDP before looping them back
|
* received from UDP before looping them back
|
||||||
*/
|
*/
|
||||||
void rxe_loopback(struct sk_buff *skb)
|
static int rxe_loopback(struct sk_buff *skb, struct rxe_pkt_info *pkt)
|
||||||
{
|
{
|
||||||
struct rxe_pkt_info *pkt = SKB_TO_PKT(skb);
|
memcpy(SKB_TO_PKT(skb), pkt, sizeof(*pkt));
|
||||||
|
|
||||||
if (skb->protocol == htons(ETH_P_IP))
|
if (skb->protocol == htons(ETH_P_IP))
|
||||||
skb_pull(skb, sizeof(struct iphdr));
|
skb_pull(skb, sizeof(struct iphdr));
|
||||||
else
|
else
|
||||||
skb_pull(skb, sizeof(struct ipv6hdr));
|
skb_pull(skb, sizeof(struct ipv6hdr));
|
||||||
|
|
||||||
if (WARN_ON(!ib_device_try_get(&pkt->rxe->ib_dev)))
|
if (WARN_ON(!ib_device_try_get(&pkt->rxe->ib_dev))) {
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
else
|
return -EIO;
|
||||||
rxe_rcv(skb);
|
}
|
||||||
|
|
||||||
|
rxe_rcv(skb);
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rxe_xmit_packet(struct rxe_qp *qp, struct rxe_pkt_info *pkt,
|
int rxe_xmit_packet(struct rxe_qp *qp, struct rxe_pkt_info *pkt,
|
||||||
|
@ -434,14 +438,10 @@ int rxe_xmit_packet(struct rxe_qp *qp, struct rxe_pkt_info *pkt,
|
||||||
goto drop;
|
goto drop;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pkt->mask & RXE_LOOPBACK_MASK) {
|
if (pkt->mask & RXE_LOOPBACK_MASK)
|
||||||
memcpy(SKB_TO_PKT(skb), pkt, sizeof(*pkt));
|
err = rxe_loopback(skb, pkt);
|
||||||
rxe_loopback(skb);
|
else
|
||||||
err = 0;
|
err = rxe_send(skb, pkt);
|
||||||
} else {
|
|
||||||
err = rxe_send(pkt, skb);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
rxe->xmit_errors++;
|
rxe->xmit_errors++;
|
||||||
rxe_counter_inc(rxe, RXE_CNT_SEND_ERR);
|
rxe_counter_inc(rxe, RXE_CNT_SEND_ERR);
|
||||||
|
|
Loading…
Reference in New Issue