在 2018/9/17 17:55, Leon Romanovsky 写道: > On Mon, Sep 17, 2018 at 03:02:24PM +0800, oulijun wrote: >> 在 2018/9/15 18:27, Leon Romanovsky 写道: >>> On Sat, Sep 15, 2018 at 06:08:57PM +0800, Lijun Ou wrote: >>>> According to the hardware modification, the vlan of the UD >>>> packet is based on the ud_vlan_en field of ud wqe to >>>> determine whether to add a vlan header to the ud >>>> packet. The ud_vlan_en field is filled by the driver >>>> according to judge the net device. >>>> >>>> Signed-off-by: Lijun Ou <oulijun@xxxxxxxxxx> >>>> --- >>>> drivers/infiniband/hw/hns/hns_roce_ah.c | 6 +++++- >>>> drivers/infiniband/hw/hns/hns_roce_device.h | 1 + >>>> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 3 +++ >>>> drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 2 ++ >>>> 4 files changed, 11 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/infiniband/hw/hns/hns_roce_ah.c b/drivers/infiniband/hw/hns/hns_roce_ah.c >>>> index 0d96c5b..004b315 100644 >>>> --- a/drivers/infiniband/hw/hns/hns_roce_ah.c >>>> +++ b/drivers/infiniband/hw/hns/hns_roce_ah.c >>>> @@ -49,6 +49,7 @@ struct ib_ah *hns_roce_create_ah(struct ib_pd *ibpd, >>>> struct hns_roce_ah *ah; >>>> u16 vlan_tag = 0xffff; >>>> const struct ib_global_route *grh = rdma_ah_read_grh(ah_attr); >>>> + bool vlan_en = false; >>>> >>> You are not changing this variable and not using it in any decision making. >>> This patch most probably doesn't do what you expected from it. >> Hi, leon >> The goal that defines av.vlan_en is to configure the vlan_en filed of ud wqe. when judge the device is vlan device. Is ok? > > No, vlan_en is always false in your patch. > > Thanks > Sorry, the code is fixed in error way from my locate place. thanks. I will fixes it in next patch.