mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 06:33:34 +00:00
Revert "RDMA/rxe: Remove VLAN code leftovers from RXE"
This reverts commitb2d2440430
. It's true that creating rxe on top of 802.1q interfaces doesn't work. Thus, commitfd49ddaf7e
("RDMA/rxe: prevent rxe creation on top of vlan interface") was absolutely correct. Butb2d2440430
was incorrect assuming that with this change, RDMA and VLAN don't work togehter at all. It just has to be set up differently. Rather than creating rxe on top of the VLAN interface, rxe must be created on top of the physical interface. RDMA then works just fine through VLAN interfaces on top of that physical interface, via the "upper device" logic. This is hard to see in the rxe logic because it never talks about vlan, but instead rxe carefully selects upper vlan netdevices when working with packets which in turn imply certain vlan tagging. This is all done correctly and interacts with the gid table with VLAN support the same as real HW does.b2d2440430
broke this setup deliberately and should thus be reverted. Also,b2d2440430
removed rxe_dma_device(), so adapt the revert to discard that hunk. Fixes:b2d2440430
("RDMA/rxe: Remove VLAN code leftovers from RXE") Link: https://lore.kernel.org/r/20210120161913.7347-1-mwilck@suse.com Signed-off-by: Martin Wilck <mwilck@suse.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
parent
f068cb1db2
commit
f1b0a8ea9f
@ -8,6 +8,7 @@
|
||||
#include <linux/if_arp.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <net/udp_tunnel.h>
|
||||
#include <net/sch_generic.h>
|
||||
#include <linux/netfilter.h>
|
||||
@ -153,9 +154,14 @@ static int rxe_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
|
||||
{
|
||||
struct udphdr *udph;
|
||||
struct net_device *ndev = skb->dev;
|
||||
struct net_device *rdev = ndev;
|
||||
struct rxe_dev *rxe = rxe_get_dev_from_net(ndev);
|
||||
struct rxe_pkt_info *pkt = SKB_TO_PKT(skb);
|
||||
|
||||
if (!rxe && is_vlan_dev(rdev)) {
|
||||
rdev = vlan_dev_real_dev(ndev);
|
||||
rxe = rxe_get_dev_from_net(rdev);
|
||||
}
|
||||
if (!rxe)
|
||||
goto drop;
|
||||
|
||||
|
@ -872,6 +872,11 @@ static enum resp_states do_complete(struct rxe_qp *qp,
|
||||
else
|
||||
wc->network_hdr_type = RDMA_NETWORK_IPV6;
|
||||
|
||||
if (is_vlan_dev(skb->dev)) {
|
||||
wc->wc_flags |= IB_WC_WITH_VLAN;
|
||||
wc->vlan_id = vlan_dev_vlan_id(skb->dev);
|
||||
}
|
||||
|
||||
if (pkt->mask & RXE_IMMDT_MASK) {
|
||||
wc->wc_flags |= IB_WC_WITH_IMM;
|
||||
wc->ex.imm_data = immdt_imm(pkt);
|
||||
|
Loading…
Reference in New Issue
Block a user